title: Printing char pointer in C - I keep getting bad formatting
body: <p>I am reading a line from a file containing the names of people, first line contains names of males, and seconds line contains names of females. Then I want to store these names in two arrays, one for males, one for females, however when I print them I get weird things. I'm not sure if I am not reading them correctly, or printing them incorrectly</p>
  
  <pre><code>    char line[100];      //holds line read
      char *item;         //item in a line
      char *item2;
      int participants = 5;   //number of people in the event
  
              char* maleNames[participants];
              char* femaleNames[participants];
  
              fgets(line, 255, file);
              int i;
              item = strtok(line, " ");
              for(i=0; i&lt;participants; i++)
              {
                  maleNames[i] = item;  
                  item = strtok(NULL, " ");
  
  
                 }
  
          //read female names now
          fgets(line, 1024, file);
          item2 = strtok(line, " ");
          for(i=0; i&lt;participants; i++)
          {
              femaleNames[i] = item2;
              item2 = strtok(NULL, " ");
          }
  </code></pre>
  
  <p>These lines are read</p>
  
  <pre><code>John Jeffrey Adam Mark Peter
  Jenny Alice Sally Wendy Amanda
  </code></pre>
  
  <p>However when I print them out like this:</p>
  
  <pre><code>        for(i=0;i&lt;participants;i++)
          {
              printf("%s %s\n", maleNames[i], femaleNames[i]);
          }
  </code></pre>
  
  <p>I get something so different:</p>
  
  <pre><code>Jenny Jenny
   Alice
  ally Sally
  Wendy Wendy
   Amanda
  </code></pre>
  
  <p>Note: if I print the names of males right after they're read before reading the female names, then they are printed correctly</p>