C Data Types
The different data types in C all have their own characteristics.
int x and you try and initialize it with a fractional number, the fractional part will be discarded since
x stores an
Arrays are intialized as normal, but followed by
n items that should reside in the array:
The following list is only what I've used most and by no means a complete list. Look at the Wikipedia page for more info.
||Used for characters within strings (array of chars)|
||Used for numbers and traversing data from stdin|
||Use for floating point numbers|
||Use for really long floating point numbers|
Unsigned numbers are always zero or higher and will have a range of 0 to (2^n) - 1. Signed numbers are negative or positive and have a range of -(2^n-1) to (2^n-1) - 1.
int's can be
long. Each processor has their own limitations they will choose, but
short is always smaller than
short must be at least 16 bits, and
long must be at least 32 bits. It is usually the case that
short is 16 bits and
long is 32 bits, but the real value on your processor can be found as symbolic constants within the
int values can be represented as standard decimal (
123), octal (
0173), or as hexadecimal (
long double represents extended-precision floating point. The processor decides the final size of floats and the real values can be found as symbolic constants within the
Last modified: 202206101419