please read the C language manual/reference text available to you for the behaviour of file handles after the execution of the specific file read/write functions that you are using. The text should specifically mention the position of the file pointer before and after the read/write function calls.
Also, there is a file function which I cannot remember about (due to lack of touch for long time) which actually lets you "surf" through a file. It would be good if GCDEF or some other senior member points out the name of that function for you. You may also find that function in your reference manual.
If you do not posses a reference manual, there are a thousand C reference manuals on the internet. Also, you can find a C tutorial I created and distribute freely on the internet at [link] http://www.mediafire.com/?pcfbjh1hwanqzbc[/link]. This tutorial contains all information about C language (well, more or less, it's been made from K & R second edition as the source), and going through it will give you a very comprehensive idea about C programming. But it will be difficult to search of this function here. You can try the last two session, it's in there somewhere.