Q
What is the correct order of stages when building a C++ program?
-
A
Preprocessing → Linking → Compilation → Assembly
-
B
Preprocessing → Compilation → Assembly → Linking
-
C
Compilation → Preprocessing → Linking → Assembly
-
D
Compilation → Assembly → Preprocessing → Linking
Correct Answer:
B. Preprocessing → Compilation → Assembly → Linking
Explanation:
#include and macros are expanded first, then the code is compiled to assembly, assembled to object code, and linked.
ALSO KNOW (related points):
• What does #include do in C++? → The preprocessor textually inserts the header's contents before compilation