我有一個問題我想退出while語句時,按德空格鍵 但在C無法識別十六進制數字,下面的代碼讀取功能。在C讀取功能無法識別十六進制
while (c!='0x20')
{
if (read(tty_fd,&c,1)>0) write(STDOUT_FILENO,&c,1);
// if new data is available on the serial port, print it out
if (read(STDIN_FILENO,&c,1)>0)
{
printf("\ningresaste %c ",c);
write(tty_fd,&c,1);
// if new data is available on the console, send it to the serial port
}
}
對不起我的英文。
!C = 0×20,應該是這樣的 – 999k
0x20的是十進制32或者你可以只使用'「」' – keshlam
是「」,這沒關係。 – Premier