Say we have opened a text file. Is it possible to define a pointer to a character in the file? If it is - will the following characters in the file appear in memory in the same order they appear in the file?
The reason I ask:
I need to process a text file. I read one line at a time and there are certain strings I want to keep. The buffer I read into always changes, so I can't keep a pointer into it. On the other hand, I don't want to waste space by defining an array and strcpy
the characters from the text file into it.
I actually want to access a file as though it were an in-memory array.
Edit:
I can use only C standard library functions. But thanks for the other suggestions, anyway.