What is the difference between #include <header file> and #include “header file” ?

devquora
devquora

Posted On: Feb 22, 2018

 

  • #include “myheaderfile.h”
  • #include <headerfile.h>

The difference between these two is the location the compiler searches for the header file to be included. If the file name is enclosed in quotes, the compiler searches in the same directory in which the file is included. This method is normally used to include programmer defined headers. If the file name is enclosed in brackets which are used for standard library headers; the search is performed in an implementation dependent manner, normally through pre-designated directories. These both file inclusions one using angle brackets and the other using quotes in an include statement can be used in C and C++.

It does:

“path/myheaderfile.h” is short for ./path/myheaderfile.h

is short for /path/headerfile.h

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C Programming Interview Questions

    What are static variables in C ?

    C defines another class of variables called static variables. Static variables are of two types:Static variables tha..

    C Programming Interview Questions

    What is a scope resolution operator in C ?

    The scope resolution operator (::) is useful in C programming when both global and local variables have the same name,..

    C Programming Interview Questions

    What is register variable in C language ?

    C language allows the use of the prefix register in primitive variable declarations. Such variables are called register..