C Quiz – 110 | Question 2
The following program won’t compile because there’re space between macro name and open parenthesis.
Explanation: Please note that #define is a preprocessor directive i.e. it’s processed before actual compilation takes place. In the above program snippet MYINC isn’t used in the program anywhere. So even though MYINC doesn’t perform the intended behaviour i.e. it won’t increment a, but MYINC is a valid macro. If we had used MYINC anywhere in the program, it would have been replaced with “( a ) ( ( a ) + 1 )”. So above program will compile and run without any issue.
Quiz of this Question
My Personal Notes arrow_drop_up
Please Login to comment...