0

When using >> to extract data from an istream, are spaces skipped over? I.e., if I extracted every character from: "Hello, my name is not World.", would the 5 spaces not be read by >>?

If so, is this behavior omitted from istream::get()?

Thanks.

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by titaniumdecoy
0

You can easily test your question yourself. Write a small program to find out how the >> operator behaves. I could easily tell you, but testing it out yourself is a much better teacher.

0

You can easily test your question yourself. Write a small program to find out how the >> operator behaves. I could easily tell you, but testing it out yourself is a much better teacher.

I had tried it, and the results I got led me to believe that the behavior I asked about above is correct (ie, >>: no spaces, get: spaces). I was just confirming it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.