Difference between " and < for #include preprocessor directive

#include preprocessor directive is used to include a header file in C++.
This tells the preprocessor to open the named header file and insert its contents where the #include statement appears. 
For #include may name a file in two ways: using angle brackets (< >) or in double quotes(").



File names in angle brackets, such as:
     #include

cause the preprocessor to search for the file in “include search path” that you specify in your environment or on the compiler command line.



File names in double quotes, such as:

    #include "header"
tell the preprocessor to search for the file in “current" directory. If the file is not found, then the include directive is reprocessed as if it had angle brackets instead of quotes.



No comments:

Post a Comment

Golang: Http POST Request with JSON Body example

Go standard library comes with "net/http" package which has excellent support for HTTP Client and Server.   In order to post JSON ...