Advertisment
This is a complete File I/O tutorial that starts with the very basics, and goes to the advanced topics. Includes many code examples.
How to find the first occurance of a string within a file, includes sample function.
Detection of End-of-file condition is necessary for preventing any further attempt to read data from the file.