C 对termios.h常量感到困惑
测试cC 对termios.h常量感到困惑,c,termios,C,Termios,测试c #include <termios.h> #include <stdio.h> int main() { printf("%x\n",B600); } 在/usr/include/x86_64-linux-gnu/bits/termios.h的内部: #define B600 0000010 其他标头都没有定义B600。其中8的值来自哪里?在C中,以零开头的数字文字被解释为八进制数,因此010表示八进制中的10,因此8。在C中,以零开头的数字文
#include <termios.h>
#include <stdio.h>
int main() {
printf("%x\n",B600);
}
在/usr/include/x86_64-linux-gnu/bits/termios.h的内部:
#define B600 0000010
其他标头都没有定义B600。其中8的值来自哪里?在C中,以零开头的数字文字被解释为八进制数,因此010表示八进制中的10,因此8。在C中,以零开头的数字文字被解释为八进制数,因此010表示八进制中的10,因此8
#define B600 0000010