title: Does a pointer move on to the next line in an array on its own if in a loop?
body: <p>In my program, pointer is an address on the first line of text in a file, pointer_ew is an address on the third line of text in a file. I am trying to print the text in between the addresses in a different file. I was wondering does the pointer move on to the next line on its own when it encounters a new line or a null character? If no, please explain what kind of errors would the following code lead to?</p>
  
  <pre><code> int m=row_ew[pick_ew]; /* m is equal to 2, which is the address to the first element of the third row in the array*/ 
   int n=pos_ew[pick_ew]; /* n is equal to the index of the word in the third line to increment the pointer position to the address of the first character of the word*/
  
   pointer_ew=file[m]+n+strlen(endword); /* Add the length of the word to increment the pointer to the end of the word*/
  
   pointer=file[i]; /*i is 0, address to the first element of the first row in the array*/
  
   while(pointer!=pointer_ew)
   {
     fputc(*pointer,outfile);
     pointer++;
   }
  </code></pre>
  
  <p>It is working fine, but I dont see the random characters in the file I am trying to copy from. But I do see it in the file to which I am copying to. At the beginning of the line, in the output file I see some extra random characters (&lt;´ri ) along with the copied text.   </p>