(Quick) C: Data types

Here a quick table of data types you can use. It’s more C related, but it might be helpfully if you want to put the number “129” in a char.

Type
Bytes
Range
Keyword
(Signed) char
8
-128 to 127
char
Unsigned char
8
0 to 255
unsigned char / u8
(Signed) int
16
-32768 to 32767
int
unsigned int
16
0 to 65535
unsigned int / u16
(Signed) short (int)
8
-128 to 127
short int / short
Unsigned short (int)
8
0 to 255
unsigned short int / unsigned short
(Signed) long (int)
32
-2147483648 to 2147483647
long int / long
Unsigned long (int)
32
0 to 4294967295
unsigned long int / unsigned long / u32
Float
32
3.4e-38 to 3.4e+38
float
Double
64
1.7e-308 to 1.7e+308
double
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: