title: Printing this array in C
body: <p>I am storing strings from a text file into two different arrays. An example of one line of the text file would look like </p>
  
  <blockquote>
    <p>(word);(word2)</p>
  </blockquote>
  
  <p>Word is being stored into eng[] and word2 would be stored into pir[].</p>
  
  <pre><code>i = 0;
  int currentChar;
  while( currentChar != EOF ) {   
      fscanf(inFile, "%[^;]; %[^\n]", eng[i], pir[i]);
  
      printf("%s ", pir[i]);
      currentChar = fgetc( inFile );
  
      i++;
  
  }
  </code></pre>
  
  <p>If I do a loop to print out all the elements inside eng[], I will get everything inside printed out.</p>
  
  <pre><code> printf("%s ", eng[i]);
  </code></pre>
  
  <p>But when trying to print out the pir array, I do not get the same thing. In order to get each element printed out, I need to do</p>
  
  <pre><code> printf("%s\n", pir[i]);
  </code></pre>
  
  <p>But then it prints each element on a separate line, when I want it all on one line.</p>
  
  <p>I'm unsure why it is doing this (I'm new to C). Why is this happening and what can I do to make it print out on one line?</p>