CSI 2

CSI 2

Basic data types in C


Char

The char value is stored as a number indicating the ASCII code of that character.

'\' - escape character

Special characters


Variables

Declaration - define a variable with a name and find a place for it in memory. Value of the variable before assignment is going to be undefined (aka "junk")

int x;

Assignment - assign a value to the variable (store a value in memory in the corresponding address)

x = 1;

Initialization - combination of declaration and assignment

int x;
x = 1;
// or
int x = 1;

Variable identifiers

Identifiers can consist of the Latin letters (A-Za-z), underscores (_) and digits (0-9), although the first character cannot be a digit.
Identifiers cannot shadow C reserved words (if, for, etc.)