Primitive Types
What type of things we can put inside a box
Primitive Types
Some basic things that we would put in a box
Variables are containers for values. We use different typed variables to store different typed values, e.g. integer, decimal, text.
These are the primitive types in C, the most basic variable types:
Type | Description | Example Literal |
---|---|---|
| 8-bit integer* for storing an ASCII character |
|
| 16-bit/32-bit signed integer** |
|
| 32-bit, single-precision floating point value (i.e. dotted number) |
|
| 64-bit, double-precision floating point value (i.e. a longer dotted number) |
|
| the absence of type (i.e. no type) | / |
*Whether
char
is signed or unsigned is machine-dependent.**Size is compiler-dependent and machine-dependent.
Variable Declaration
Last updated