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

Question: 1 / 565

What command is used to compile 'hello.cpp' using a macro?

$(CPP) hello.cpp

This answer is incorrect because the command '$(CPP)' is a shell macro and not a compiler macro. It will not compile the given C++ file. Option B, 'compile hello.cpp', is not a valid command and will not be recognized by the compiler. Option C, 'CPP -o hello.exe hello.cpp', will not work because 'CPP' is not a valid compiler command. Option D, 'make hello.cpp', will not work because 'make' is used to create executable files from multiple source files, not just one like in this case. Therefore, option A, '$(CPP) hello.cpp', is the correct command for compiling 'hello.cpp' using a macro.

Get further explanation with Examzify DeepDiveBeta

compile hello.cpp

CPP -o hello.exe hello.cpp

make hello.cpp

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy