int变量有前导零? [英] int variable with leading zero?
本文介绍了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变量有前导零?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文