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.
如何在 C++ 中的字符串序列末尾模拟“转义键”,就好像按下了转义键一样?
我需要提供标准输入,它接受字符串数据,直到按下 Escape 键,
因为它正确接收字符,但我最终如何发送“转义键击”?
“转义”的 ASCII 码是 27(= 十六进制的 1b)。要发送转义,您只需发送该字符'\0x1b'。
'\0x1b'