Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
实际上,我正在尝试从用户那里获取输入,直到他按下+CTRL或1+CTRL或D+CTRL或s或ESC{键盘按钮}ENDF7
每当用户按下指定按钮或这些按钮的组合时,如何让我的 perl 代码知道这一点?
use strict; use Term::ReadKey; ReadMode 4; my $key = ReadKey(0); print "Get key ", ord($key), "\n"; ReadMode 0; # Reset tty mode before exiting
为什么在我的电脑上cout<<main;打印1?我以为它会打印main的地址。但是当我使用时,printf("%x",main);我会得到不同的输出。
cout<<main;
1
printf("%x",main);
编辑:
我尝试std::cout了其他功能。我得到1了每一个案
std::cout