他的路线做了什么? [英] What does his line do?
本文介绍了他的路线做了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我检查输入是否正确(用户输入与变量类型匹配)时,需要该行:
When i check if the input was correct (that the user input matching the variables type) there is a need of the line :
cin.ignore(numeric_limits<streamsize>::max(), '\n');
这行做什么?
谢谢!
what does this line do?
thanks!
推荐答案
参考文献:
http://www.cplusplus.com/reference/istream/istream/ignore/ [ ^ ]
参见:
http://stackoverflow.com/questions/25020129/cin-ignorenumeric-limitsstreamsizemax-n [ ^ ]
reference is here:
http://www.cplusplus.com/reference/istream/istream/ignore/[^]
See also:
http://stackoverflow.com/questions/25020129/cin-ignorenumeric-limitsstreamsizemax-n[^]
这篇关于他的路线做了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文