cin.ignore(numeric_limits< streamsize> :: max(),'\n') [英] cin.ignore(numeric_limits<streamsize>::max(), '\n')
本文介绍了cin.ignore(numeric_limits< streamsize> :: max(),'\n')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
cin.ignore(numeric_limits< streamsize> :: max(),'\n')
在C ++中是什么意思?
What does cin.ignore(numeric_limits<streamsize>::max(), '\n')
mean in C++?
它实际上是否忽略了用户的最后输入?
Does it actually ignore the last input from the user?
推荐答案
此行将忽略当前行的其余部分,直到'\n'
或 EOF
-以先到者为准:
This line ignores the rest of the current line, up to '\n'
or EOF
- whichever comes first:
-
'\n'
设置分隔符,即cin
停止忽略的字符 -
numeric_limits< streamsize> :: max()
设置要忽略的最大字符数。由于这是流大小的上限,因此您实际上是在告诉cin
对要忽略的字符数没有限制。
'\n'
sets the delimiter, i.e. the character after whichcin
stops ignoringnumeric_limits<streamsize>::max()
sets the maximum number of characters to ignore. Since this is the upper limit on the size of a stream, you are effectively tellingcin
that there is no limit to the number of characters to ignore.
这篇关于cin.ignore(numeric_limits< streamsize> :: max(),'\n')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文