MULTIPLE CHOICE QUESTIONS AND ANSWERS
  1. True/False: The ampersand (&) is used to dereference a pointer variable in C++.

    Answer: False

  2. When the ___________ is present in front of a variable name, it represents the address of that variable.
    1. asterisk ( * )
    2. conditional operator
    3. ampersand ( & )
    4. semicolon ( ; )
    5. None of these

    Answer: (c)

  3. A pointer variable may be initialized with
    1. any non-zero integer value
    2. any address in the computer's memory
    3. the address of an existing variable
    4. a and c only
    5. None of these

    Answer: (b)

  4. A pointer variable is designed to store ________.
    1. any legal C++ value
    2. only floating-point values
    3. a memory address
    4. a float value
    5. None of these

    Answer (c)

  5. We should use the delete operator for objects that were ________.
    1. never used

Get Object Oriented Programming with C++, Second 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.