Question: Preprocessor Commands in C++: Note the code and preprocessor instructions in order to answer each question. What will the following code do? #define plus +

Preprocessor Commands in C++: Note the code and preprocessor instructions in order to answer each question.

What will the following code do?

#define plus + int main() { cout << (3 plus 5) << endl; }

A. The program will compile, but immediately crash.
B. The program will not compile because C++ expects there to be an operator between 3 and 5, not a variable name.
C. The program will not compile because 'plus' is not a declared variable.
D. The program will compile and print '8'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!