Introduction to C++
When declaring a variable, you need to specify what kind of data we will store in it, or rather, "what type".
C++ has a large number of data types for easy memory handling. The most common is
char, other data types come from them.
int data type corresponds to positive and negative integers.
The data type
double corresponds to positive and negative non-integer numbers.
bool data type corresponds to 2 boolean values:
true). Usually, they describe the state of the «button».
- Light on = true = 1;
- Light off = false = 0.
char data type stores a single character value:
The data type tells the compiler how much memory you need to store your data. If the number that you are going to store in the variable is larger than the type of the variable allows, then an overflow will occur.
When we run this program, we will see that, for some reason, our variable has become equal to -2147483648...:
Choose correct type for variable:
Select the correct answer