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 keyword produces the address of the struct in its member function context?

  1. static

  2. this

  3. super

  4. base

The correct answer is: this

Because static, super, and base are all reserved keywords in programming, they cannot be used as variable names, including in the member function context. The keyword "this" is used within a struct or class to refer to the current instance of the struct or class. This allows the member functions of the struct or class to access its own internal variables and data. Therefore, the keyword "this" is the only option that is applicable and appropriate for finding and referencing the address of the struct in its member function context.