C - Variable Types and Typical Value Ranges

Introduction

Type
Typical number of bytes
Typical range of values
char
1
-128 to +127 or 0 to +255
unsigned char
1
0 to +255
short
2
-32,768 to +32,767
unsigned short
2
0 to +65,535
int
2 or 4
-32,768 to +32,767 or -2,147,438,648 to +2,147,438,647
unsigned int
4
0 to +65,535 or 0 to +4,294,967,295
long
4
-2,147,438,648 to +2,147,438,647
unsigned long
4
0 to +4,294,967,295
long long
8
-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807
unsigned long long
8
0 to +18,446,744,073,709,551,615
float
4
+/-3.4E+/-38 (6 digits)
double
8
+/-1.7E+/-308 (15 digits)
long double
12
+/-1.2E+/-4932 (19 digits)

Related Topic