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.
我这里有个情况
我正在接受用户的输入
使用 scanf 我可以在用户按下 # 键后立即终止 scanf
请告诉我这个
不,scanf()(或者更确切地说是标准输入,默认情况下)是面向行的,因此它需要读取整行。
scanf()
查看ncurses或类似的库以获取“原始”按键输入。