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

Discussion

During preprocessing, the code #include gets replaced by the contents of the file stdio.h. Which is true?

  • A.During linking the code #include replaces by stdio.h
  • B.Yes
  • C.During execution the code #include replaces by stdio.h
  • D.During editing the code #include replaces by stdio.h

Answer: B

Correct answer: Yes

The statement is correct: #include is handled by the preprocessor, which runs before compilation and replaces the directive with the entire contents of the named file.

The result is a single translation unit containing the program text and every header it pulled in. What the header supplies is declarations - types and function signatures - so that the compiler can check calls. The functions themselves live in the library and are joined at link time, which is a later and quite separate stage.

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

Post your comment

Please log in or register to post a comment.