1. Home
  2. Computer Science MCQs
  3. C Programming
  4. What is the practical difference between #include…

Added 30 Nov -0001

What is the practical difference between #include <stdio.h> and #include "myheader.h"?

  1. Both forms behave identically in every compiler, and the difference between them is purely stylistic and has no effect on the search order at all
  2. The quoted form searches the including file's directory or a configured path first, then the system paths, while the angle form searches only the system paths Correct answer
  3. The angle form is reserved for C++ standard library headers and the quoted form for C project headers, so the two never overlap in practice
  4. The quoted form embeds the file as a string literal rather than including it, so any macros defined in that file are not visible to the rest of the translation unit

Correct answer

B. The quoted form searches the including file's directory or a configured path first, then the system paths, while the angle form searches only the system paths

18 views

MCQSEXAM

Explanation

Header search order differs: the quoted form looks in the directory of the source file or an implementation-defined place before falling back to the system paths, which is how project headers are found. The angle form goes straight to the system or -I paths, so it is used for library headers. Both perform textual inclusion before compilation and neither is language-specific.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs