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 operator is used to access members of a structure through a pointer?

  1. ->

  2. .

  3. ::

  4. []

The correct answer is: ->

The arrow operator "->" is used to access members of a structure through a pointer because it dereferences the pointer and then accesses the specified member within the structure. The dot operator (B) is used to access members of a structure using the actual structure name, not a pointer. The scope resolution operator (:) (C) is used to access members of a namespace or a class within a namespace. The brackets operator (D) is used for array indexing, not for accessing structure members.