Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following statement is not true about preprocessor directives?

  • A.These are lines read and processed by the preprocessor
  • B.They do not produce any code by themselves
  • C.These must be written on their own line
  • D.They end with a semicolon

Answer: D

Correct answer: They end with a semicolon

This is the false statement. A preprocessor directive is terminated by the end of the line, not by a semicolon - and adding one has consequences, since a semicolon written at the end of a #define becomes part of the replacement text and is substituted along with the value.

The other three are true: directives are read and processed by the preprocessor, they generate no code themselves but control what the compiler sees, and each must occupy its own line.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.