字符什么时候存储在Buffer中
我只是想知道某人从键盘输入的字符什么时候存储在缓冲区中?我的意思是:当按下字符键时,或者当按下回车键时,或者还有其他时机?我的问题特别针对 C++ 控制台应用程序,但如果答案包含所有情况或一般情况,那就更好了!
多谢 :)
I just want to know when are characters that sb enter from the keyboard stored in the buffer? I mean : when the character key is pressed, or when enter is pressed, or there is another timing? my question is especially for c++ Console apps, but it will be even better if the answers contained every case, or a general case!
thanks a lot :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这将取决于所讨论的特定控制台。
即使它们适用于不同的语言,相同的规则也适用于终端/环境如何向程序提供标准输入上的数据:
此线程 据说有一个 Visual Studio 的工作示例。
This will depend on the specific console in question.
Even though they are for different languages, same rules apply to as how the terminal/environment feeds your program with data on standard input:
This thread supposedly has a working example for Visual Studio.