w2b Declarations DONE
w2b Declarations DONE
Declarations
return 0;
}
C++ Data Type
Hàm thực hiện thao tác nhưng không trả về bất kì giá trị nào cho người gọi
Short int
int
long int
Integer
The type also defines the size of the field in which data can
be stored. In C++, even though the size is machine
dependent, most PCs use the integer sizes shown below.
-2,147,483,648 2,147,483,647
long int Signed 4 32
4,294,967,295
unsigned 0
Floating Point
float
double
long double
Floating Point
float 4 32
double 8 64
long double 10 80
Declarations
Examples:
int sum;
int total = 3445;
char answer = 'y';
double temperature = -3.14;
Variable declarations
Examples:
const char star = '*';
char letter, one = '1';