Is the EOF character specific to the C/C++ language or is it an actual byte at the end of every file? I need to create a file from an input stream and I'm having difficulties determining then end of the file being sent.
Is the EOF character specific to the C/C++ language or is it an actual byte at the end of every file? I need to create a file from an input stream and I'm having difficulties determining then end of the file being sent.
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
man I feel stupid. the one place I haven't checked
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
No worries. I've read that tutorial several times, and I am unable to make any sense of it.
I need to create a file from an input stream and I'm having difficulties determining then end of the file being sent.That while loop will terminate if a stream error occurs that prevents you from reading from the file, or if you hit the end of the file.Code:while( getline(inFile, input) ) { //do something with the input }
(Any read function that returns an istream& can be used similarly.)
Last edited by 7stud; 02-24-2006 at 11:55 PM.
Thanks 7stud, except the stream I am using is sockets, and just by thinking it through I don't think there's any way to do that with recieving. I think the only way is to use specific protocol's file transfer methods.
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com