You can't use the seek functions (find in the iostream library) for text mode files. Well, you can, but it won't give you the expected results. They can be used only in binary files. You must read the file from the beginning and search for the place you want in memory.