C Reference - Constants

Numbers characters and string constants.

See enum end const in data types page.

Data Type Constants

Syntax Description Example

0x hexnum

0X hexnum

hexadecimal number int x=0x7FFF0000;

0 octnum

octal number int x=07654321;

num u

num U

unsigned integer number constant unsigned int x=1000U;

num l

num L

long integer number constant long x=-99999L;

num ul

num UL

unsigned long integer number constant unsigned long x=99999L;

num ll

num LL

long long  integer number constant long long x=-888888LL;

num ull

num ULL

unsigned long long integer number constant unsigned long long x=100ULL;

num f

num F

float number constant float x=0.005F;

num l

num L

long double number constant long double x=0.005L;

num exp

num exp

floating point exponent number constant double x=5.2E-3;

'char'

character constant char c='A';

"string"

string constant char name[6]="Hello";

 

Escape Sequences

Write how to improve this page

C REFERENCE
RAPID TABLES