WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

C · Basic · question 14 of 100

What is the difference between #include and #include "filename"?

📕 Buy this interview preparation book: 100 C questions & answers — PDF + EPUB for $5

In C programming language, there are two ways to include header files in a program: using angle brackets (< >) or using quotes (" "). Here’s the difference between the two:

    #include <header.h>

This syntax is used to include system header files that are part of the C standard library. The compiler searches for the header file in the system directories specified by the compiler, such as /usr/include on Unix-based systems or C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools
/MSVC/14.28.29910/include on Windows systems.

    #include <stdio.h>

In this example, the stdio.h header file is included using the angle bracket syntax.

    #include "header.h"

This syntax is used to include user-defined header files that are located in the current directory or in a directory specified by the user. The compiler searches for the header file in the current directory first, and then in the directories specified by the -I flag.

    #include "myheader.h"

In this example, the myheader.h header file is included using the quotes syntax.

In summary, the main difference between #include <header.h> and #include "header.h" is in the way that the compiler searches for the header file. The angle bracket syntax is used for system header files that are part of the C standard library, while the quotes syntax is used for user-defined header files that are located in the current directory or in a directory specified by the user.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic C interview — then scores it.
📞 Practice C — free 15 min
📕 Buy this interview preparation book: 100 C questions & answers — PDF + EPUB for $5

All 100 C questions · All topics