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

Discussion

Which of the following statement is true?

  • A.During Linking the Code #include replaces by stdio.h
  • B.During Preprocessing the Code #include replaces by stdio.h
  • C.During Execution the Code #include replaces by stdio.h
  • D.During Editing the Code #include replaces by stdio.h

Answer: B

Correct answer: During Preprocessing the Code #include replaces by stdio.h

#include is a preprocessor directive, and the preprocessor runs before the compiler sees anything. It replaces the directive with the entire text of the named file, producing a single translation unit.

What is inserted is declarations, not code: the header tells the compiler the types and signatures of the library functions, while the functions themselves live in the library and are joined at link time. Confusing the two is what makes a missing library a puzzling error, since the header alone compiles perfectly well.

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

Post your comment

Please log in or register to post a comment.