VC++ tutorial

Visual C++ Examples

How To Add Menu In VC++

adplus-dvertising
Data Type In VC++
Previous Home Next

A classification of the type of data that a variable or object can hold in computer programming. Data types are an important factor in virtually all computer programming language. for example: integer, floating point, character, string, and pointer.

Fundamental of Datatypes

TypeSize in BytesRange of ValuesExamples of Literals
bool 1 true or false true, false
char 1

By default the same as type signed char: –128 to +127.

Optionally you can make char the same range as type unsigned char.

‘A’, ‘Z’, ‘8’, ‘*’
signed char 1 –128 to +127
unsigned char 1 0 to 255
wchar_t 2 0 to 65,535 L’A’, L’Z’, L’8’, L’*’
short 2 –32,768 to +32,767
unsigned short 2 0 to 65,535
int 4 -77, 65, 12345, 0x9FE
unsigned int 4 0 to 4,294,967,295 10U, 64000U
long 4 –2,147,483,648 to 2,147,483,647 -77L, 65L, 12345L
unsigned long 4 0 to 4,294,967,295 5UL, 999999999UL
float 4 ±3.4×10±38 with approximately 7 digits accuracy 3.14f, 34.506f
double 8 ±1.7×10±308 with approximately 15 digits accuracy 1.414, 2.71828
long double 8 ±1.7×10±308 with approximately 15 digits accuracy 1.414L, 2.71828L
Previous Home Next