C++ Trivia Quiz: Types Of Operators And Variables!

76 Questions | Attempts: 226
Share

SettingsSettingsSettings
C++ Trivia Quiz: Types Of Operators And Variables! - Quiz

The quiz below is perfectly designed to test your understanding when it comes to the types and variables of the C++ programming languages. For you to pass that certification exam, you need to have a proper understanding of this topic. So, take up this quiz and see if you need more time to study well before the exam is due.


Questions and Answers
  • 1. 
    Each byte in memory is assigned a unique __________.
  • 2. 
    The __________ operator can be used to determine a variable's address
  • 3. 
    _____________ variables are designed to hold addresses.
  • 4. 
    The ____________ operator can be used to work with the variable a pointer points to.
  • 5. 
    Array names can be used as _____________, and vice versa.
  • 6. 
    Creating variables while a program is running is called __________.
  • 7. 
    The __________ operator is used to dynamically allocate memory.
  • 8. 
    Under older compilers, if the new operator cannot allocate the amount of memory  requested, it returns __________.
  • 9. 
    A pointer that contains the address 0 is called a(n) __________ pointer.
  • 10. 
    When a program is finished with a chunk of dynamically allocated memory, it should  free it with the __________ operator.
  • 11. 
    You should only use pointers with delete that were previously used with  __________.
  • 12. 
    The & symbol is called the indirection operator.
    • A. 

      True

    • B. 

      False

  • 13. 
    The & operator dereferences a pointer.
    • A. 

      True

    • B. 

      False

  • 14. 
    When the indirection operator is used with a pointer variable, you are actually working with the value the pointer is pointing to.
    • A. 

      True

    • B. 

      False

  • 15. 
    Array names cannot be dereferenced with the indirection operator.
    • A. 

      True

    • B. 

      False

  • 16. 
    When you add value to a pointer, you are actually adding that number times the size of the data type referenced by the pointer.  
    • A. 

      True

    • B. 

      False

  • 17. 
    The address operator is not needed to assign the address an array to a pointer.
    • A. 

      True

    • B. 

      False

  • 18. 
    You can change the address that an array name points to.
    • A. 

      True

    • B. 

      False

  • 19. 
    Any mathematical operation, including multiplication and division, may be performed on a pointer.
    • A. 

      True

    • B. 

      False

  • 20. 
    Pointers may be compared using the relational operators.
    • A. 

      True

    • B. 

      False

  • 21. 
    When used as function parameters, reference variables are much easier to work with than pointers.
    • A. 

      True

    • B. 

      False

  • 22. 
    The new operator dynamically allocates memory.
    • A. 

      True

    • B. 

      False

  • 23. 
    A pointer variable that has not been initialized is called a null pointer.
    • A. 

      True

    • B. 

      False

  • 24. 
    The address 0 is generally considered unusable.
    • A. 

      True

    • B. 

      False

  • 25. 
    In using a pointer with the delete operator, it is not necessary for the pointer to have been previously used with the new operator.
    • A. 

      True

    • B. 

      False

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.