a few basic file i/o questions(c++)

Started by
2 comments, last by Brother Bob 15 years, 10 months ago
ok, i have a couple questions about c++ file i/o when using the << operator, it reads till the next white space right? what about in binary mode? and what about the get() method? does this read a single char in character mode, and a single byte in binary? thanks
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
Advertisement
Binary mode does not affect how the underlying data stream is presented to your application. If you ask for a formatted integer using the >> operator, then that is exactly what you get.

Binary/text mode is mostly, of not only, about translating special characters like Windows' two consecutive new line characters to the common single character '\n' code point. Different translations exists for other operating systems, as some systems use different character combinations for special characters.
so really it depends on the data type used to hold teh data being taken in?
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
How data is given to you depends only on what types you read, yes, and what functions you use to read them. Binary or text mode is orthogonal to that concept.

This topic is closed to new replies.

Advertisement