Listen, to be honest, I stopped paying attention here after my last post, and I haven't bothered to read since, but as this keeps going I am going to respond to your last post:
I want the end result to be cross platform, thats why I need to know if ther is a EOF which all of them can recognize. Like an MKV can be viewed by all OS's but surely it only has on type of end of file. |
The EOF character is a leftover from DOS (which retained it as a leftover from CP/M), and today only exists in some old text files not properly transferred from old systems.
Don't worry about EOF. If you open your text files properly, then libc will properly discard it. If you are working with binary data, you won't have to bother worrying about it anyway, as I presume your file format will be both written and read by your program, right? It should never appear. (If it does, then the file you are trying to read is corrupt.)
Remember, EOF is a signalled state, which by definition means, "no more data"; you have attempted to read but there is nothing more to read; the file pointer is at the end of the file.