小编Gri*_*gor的帖子

从零开始的数字有什么特别之处?

这有点愚蠢的问题,但对我来说很有意思)

这就是我在visual studio 2013中获得的

int i = 07;     // i == 7
int i = 16;     // i == 16
int i = 00016;  // i == 14, why?
int i = 05016;  // i == 2574, wow )
int i = 08;     // compile error, compiler expects octal number...
Run Code Online (Sandbox Code Playgroud)

如果number从零开始并且包含8,则编译错误.这是正常的吗?如果00016 == 14,那么编译器在启动零时究竟做了什么?

谢谢大家 ))

c c++ compiler-construction syntax numbers

3
推荐指数
3
解决办法
4500
查看次数

标签 统计

c ×1

c++ ×1

compiler-construction ×1

numbers ×1

syntax ×1