Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, are the values of 024 and 24 integer constants equal?
In C language, are the values of 024 and 24 integer constants equal?
Not equal.

Starting from 0 is a constant expressed in octal;

Starting with 0x is a constant expressed in hexadecimal 16;

There is no prefix, it is a constant represented by 10.

So 024 and 24 are different.

024 is 24 in octal, which means 2* 8+4=20.

24 is 24 in 10, which means 2* 10+4=24.