ordinary
ordinary

Reputation: 6133

Reading from standard in using ios::binary

I'm trying to read from standard input and distinguish each character from one another by its decimal value. From what I understand, a Line Feed (10) and a Carriage Return (13) will be interpreted as the same character. I want to distinguish between the two. I know if I was reading from a file I could open it using the ios::binary parameter. But what about if I am reading from standard input?

Upvotes: 6

Views: 2180

Answers (1)

Ivan Kruglov
Ivan Kruglov

Reputation: 753

You can read from std::cin by using get. This method is specially designed for reading unformatted data (see doc)

Upvotes: 2

Related Questions