Variables

Every variable must be declared before it can be used. The declaration determines the variable’s type, its storage class, and possibly its initial value. The type of a variable determines how much space it occupies in storage and how the bit pattern it stores is interpreted. For example:

float dollars = 2.5F;     // a variable of type float

The variable dollars designates a region in memory with a size of 4 bytes. The contents of these four bytes are interpreted as a floating-point number, and initialized with the value 2.5.

Get C Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.