Review Questions

1:Why does C++ have more than one integer type?
2:Define the following:
  1. A short integer with the value 80

  2. An unsigned int integer with the value 42110

  3. An integer with the value 3000000000

3:What safeguards does C++ provide to keep you from exceeding the limits of an integer type?
4:What is the distinction between 33L and 33?
5:Consider the two C++ statements that follow. Are they equivalent?
char grade = 65;
char grade = 'A';
6:How could you use C++ to find out which character the code 88 represents? Come up with at least two ways.
7:Assigning a long value to a float can result in a round-off error. What about assigning long to double?
8:Evaluate the following expressions as C++ would:
  1. 8 * 9 + 2

  2. 6 * 3 / 4

  3. 3 / 4 * 6

  4. 6.0 * 3 / 4

  5. 15 % 4

9: ...

Get The Waite Group's C++ Primer Plus, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.