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.


How do you change the compiler used by the makefile according to the example?

  1. Change the CPP variable

  2. Install the new compiler in the system path

  3. Rewrite the compiler invocation commands

  4. Directly modify the compiler source code

The correct answer is: Change the CPP variable

When using a makefile, the CPP variable is responsible for specifying the compiler used for compiling code. By changing this variable, you can change the compiler used without having to rewrite the entire makefile or modify the source code. Options B and D are incorrect because they involve external actions that would not directly affect the makefile. Option C is incorrect because rewriting the compiler invocation commands would essentially be changing the makefile itself. Thus, the most efficient and effective way to change the compiler used by the makefile is to modify the CPP variable.