2.10: The Bool Data Type & 2.11 Determine the size of a Data type
Expressions that have a true or false value are called ____________expressions, named in honor of English mathematician George Boole (1815-1864).
Boolean
Declare a variable hasPassedTest, and initialize it to true .
bool hasPassedTest=true;
Declare a variable isACustomer, suitable for representing a true or false value .
bool isACustomer;
Write a literal representing the false value in C++.
false
The ___________operator may be used to determine the size of a data type on any system A special operator called sizeof will report the number of bytes of memory used by any data type or variable. Program 2-18 illustrates its use. The first line that uses the operator is line 10: cout << "The size of an integer is " << sizeof(int); The name of the data type or variable is placed inside the parentheses that follow the operator. The operator "returns" the number of bytes used by that item. This operator can be invoked anywhere you can use an unsigned integer, including in mathematical operations.
sizeof
Write an expression whose value is the number of bytes that an int variable occupies on whatever machine the expression is executed on.
sizeof(int);
Write an expression whose value is the number of bytes that an unsigned long variable occupies on whatever machine the expression is executed on.
sizeof(long);
Write a literal representing the true value .
true