Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Test your C++ skills with our quiz based on Bruce Eckel's 'Thinking in C++'. Dive into object-oriented programming, advanced topics, and fundamentals. Perfect for learners and experts alike. Assess your knowledge and become a C++ master!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What does a C++ reference act as?

  1. A new copy of the object

  2. A constant pointer automatically dereferenced

  3. A dynamically allocated memory space

  4. A template for object creation

The correct answer is: A constant pointer automatically dereferenced

A C++ reference acts as a constant pointer that is automatically dereferenced. This means that the reference points to the same memory location as the object it is referencing and any changes made to the reference will also affect the original object. Option A, a new copy of the object, is incorrect because a reference does not create a new copy of the object, it just refers to it. Option C, a dynamically allocated memory space, is incorrect because a reference does not allocate any memory, it just refers to an existing object. Option D, a template for object creation, is incorrect because a reference does not create objects or serve as a template for object creation. It simply refers to an already existing object.