Integer Constants

Depending on the first (and possibly the second) character, an integer constant is assumed to be expressed in different base values:

first second constant interpreted as
0 1-7 octal (base 8)
0 x,X hexadecimal (base 16)
1-9 decimal (base 10)

The type of an integer constant is int.


16 decimal
020 octal
0x10 hexadecimal

Index Copyright © 2005 CadSoft Computer GmbH