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.


In C++, which operator is used for concatenation of two character arrays?

  1. +

  2. .

  3. ::

  4. None, C++ does not allow direct concatenation

The correct answer is: None, C++ does not allow direct concatenation

In C++, the operator + is used for concatenation of two strings, not character arrays. Option B, the dot operator, is used for accessing members of an object and has no role in concatenation. Option C, the scope resolution operator, is not used for character array concatenation but for accessing members of a namespace or class. Option D is the correct answer as C++ does not provide a built-in concatenation operator for character arrays, but it can be achieved through other methods such as using the strcat function or overloading the + operator for character arrays.