Home : C Language : Constants
Integer constants do not contain a decimal point. They are of the
smallest type that would hold them unless they have a U or L suffix letter:
nnn signed short intif between -32768 and 32767 nnn Uunsigned short intif between 0 and 32767 nnn unsigned short intif between 32768 and 65535 nnn signed long intif greater than -32768 or 65535 nnn Lsigned long int
Octal constants have an "0" prefix: 0nnn
Hexadecimal constants have an "0x" prefix: 0xnn
Floating point constants contain a decimal point, have an
exponent, or have an F suffix letter. They are of type double unless they have an F or L suffix letter:
nn Ffloatnn .nn[Enn]Ffloatnn .nn[Enn]doublenn .nn[Enn]Llong double
Character constants are enclosed in single quotes: 'c'. The compiler will substitute the appropriate character if any of the
following "backslash" or "escape" codes are used:
\aAlert (bell) \bBackspace \fForm feed \nNewline \rCarriage return \tHorizontal tab \vVertical tab \'Single quote \"Double quote \\Backslash \0Null \nnnASCII code in octal (a maximum of three digits are recognised) \xnnASCII code in hexadecimal
String constants are enclosed in double quotes: "string". The compiler automatically appends a null character to the end of the
string.