Variable Types and Typical Value Ranges - C Data Type

C examples for Data Type:Introduction

Introduction

The following table lists Variable Types and Typical Value Ranges.

Type Typical number of bytesTypical 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 short2 0 to +65,535
int2 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 long8 0 to +18,446,744,073,709,551,615
float 4 +/-3.4E+/-38 (6 digits)
double8 +/-1.7E+/-308 (15 digits)
long double 12 +/-1.2E+/-4932 (19 digits)

Related Tutorials