Why int j = 012 giving output 10?

前端 未结 4 1716
抹茶落季
抹茶落季 2020-11-30 11:15

In my actual project It happened accidentally here is my modified small program.

I can\'t figure out why it is giving output 10?

pub         


        
4条回答
  •  广开言路
    2020-11-30 12:03

    The leading zero means the number is being interpreted as octal rather than decimal.

提交回复
热议问题