VS2015 C中八进制显示问题
#include<stdio.h>int main()
{
int x = 100;
printf("dec=%d; octal=%0;hex=%x\n", x, x, x);
printf("dec=%d;octal=%#0;hex=%#x\n", x, x, x);
return 0;
}
运行结果:
dec=100;octal=;hex=64
dec=100;octal=;hex=0x64
为什么其中的八进制无法显示
#include<stdio.h> int main() { int x = 100; printf("dec=%d;octal=%o;hex=%x\n", x, x, x); printf("dec=%d;octal=%#o;hex=%#x\n", x, x, x); return 0; }