不带参数的 istream::get() 会返回空格吗?
这似乎是一个非常简单的问题,但我在任何地方都找不到答案。如果我逐个字符地解析文件(包括换行符),则
char next = file.get();
以下检查是否为真?
if (next == '\n')
This seems like a really simple question, but I can't find the answer anywhere. If I'm parsing a file (that includes newline characters) character by character, using
char next = file.get();
will the following check ever be true?
if (next == '\n')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。它从流中获取下一个字符。它不会跳过换行符或空格。
Yes. It gets the next character from the stream. It does not skip newlines or whitespace.