本文介绍了带前导零的 int 变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么下面的结果是 34?它似乎与八进制数无关.
Why is it that following results in 34?It doesn't seem to have anything to do with octal numbers.
intval(042);
推荐答案
但是前导 0 在许多语言中确实表示八进制,就像这里的情况.
but a leading 0 does indicate octal in many languages, as is the case here.
这篇关于带前导零的 int 变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!