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

Caching is a technique used to store frequently accessed data in a temporary storage layer to improve system performance and reduce latency....