The other built-in data types
-
integer.C
.
Define (i.e., create) variables of the other signed integer data types.
-
Integer
means the values have to be whole numbers.
-
Signed
means the values can be positive, negative, or zero.
Exercises.
What is 263?
What is 215?
Why am I asking about these powers?
-
double.C
.
Define variables of types that can hold a number with a fraction.
-
format.C
.
Output more (or fewer) of the digits of a
double
.
Compile with the command line option
-std=c++20
because
std::format
is a new feature available in the C++20 version of the language C++.
-
bool.C
.
A variable of type
int
can hold one of
4,294,967,296
different values,
from -2,147,483,648 to 2,147,483,647 inclusive.
A variable of type
bool
can hold one of only
2
different values.
Exercise.
Change
true
to
false
in this program.
-
char.C
.
On
storm.cis.fordham.edu
,
a variable of type
char
can hold the code number of a single
ASCII
character.
That’s all it can hold:
one number, representing one character.
-
string.C
.
A variable of type
std::string
can hold a string (series) of characters.