top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between include <> and include "" in C and what is the recommended way?

+2 votes
540 views
What is the difference between include <> and include "" in C and what is the recommended way?
posted Aug 6, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

If a developer has created a header file then he should use " " and also should include the path while compiling the code.
In company level project, it is very common to find user defined header files and use of " " in .c files .

Double quotes " " instructs compiler to search for header files in user defined path and look into standard path if header file is not found. Angular brace <> is used when a standard header file is included in a program. And compiler also looks into standard path of header file.

answer Aug 6, 2015 by Harshita
+1 vote

Its a way of telling the compile to look for the header file i.e filename.h in to respective directory.
So, If you are including a header file using " " then at the time compilation the compiler looks for the header file into the current directory and if the header file is not found there then it will look into the standard include directory.
while if you have included the header file using < > then the compiler looks for the header file into the standard include directory.

answer Aug 7, 2015 by Arshad Khan
...