<> First, find the header file in the system directory. If the file is not found in the current directory. So use this method like standard header files stdio. h and stdlib. h.
"" Is first searched in the current directory. If it cannot be found, it is then searched in the system directory. This header file is used to include custom headers so that the system gives priority to the files defined in the current directory.
When writing your C program, you can include files in two ways. the first way is to surround the file you want to include with the angled brackets <and>. this method of definition tells the Preprocessor to look for the file in the predefined default location.
This predefined default location is often an include environment variable that denotes the path to your include files. For instance, given the include variable
C code
- Include = C: compilerinclude; s: sourceheaders;
Using the # include version of File Inclusion Sion, the compiler first checks the C: compilerinclude
Directory for the specified file. If the file is not found there, the compiler then checks the S: sourceheaders directory. If the file is still not found, the Preprocessor checks the current directory.
The second way to include files is to surround the file you want to include with double quotation marks. this method of permission sion tells the Preprocessor to look for the file in the current directory first, then look for it in the predefined locations you have
Set up.
Using the # include & ldquo; file & rdquo; version of file authentication sion and applying it to the preceding example, The Preprocessor first checks the current directory for the specified file. if the file is not found in the current directory, the C: compilerinclude directory
Is searched. If the file is still not found, the Preprocessor checks the S: sourceheaders directory.
- The # include method of File compression sion is often used to includeStandardHeaders such as stdio. h or stdlib. H. This is because these headers are rarely (if ever) modified, and they shoshould always be read from your compiler & rsquo; s standard include file
Directory.
- The # include & ldquo; file & rdquo; method of File compression sion is often used to includeNonstandardHeader files that you have created for use in your program. This is because these headers are often modified in the current directory, and you will want
Preprocessor to use your newly modified version of the header rather than the older, unmodified version.