Tell me, what is the difference between these two ways to connect the header file in C:
#include <stdlib.h>
and
#include "stdlib.h"
Tell me, what is the difference between these two ways to connect the header file in C:
#include <stdlib.h>
and
#include "stdlib.h"
When using angle brackets, the file is searched for in a specific list of directories, which is specified in the -I
compiler settings.
When using quotes, the file is searched first of all in the directory of the program itself, then in a certain list, which is set in the -iquote
compiler -iquote
.
Not sure if I understood correctly, but in Russian literature I did not notice the descriptions of these two methods.
Source: http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html
Angle brackets mean that the <stdlib.h> file will be taken from some standard directory, usually / usr / include. Quotes "" "indicates a character string Quotes are not part of a string. They are introduced only to mark its beginning and end. The preprocessor replaces this line with the contents of the stdlib.h file.
Quotes "" this is for the Preprocessor to search the file in the current directory for this line and therefore cannot be thrown out.
Source: https://ru.stackoverflow.com/questions/71806/
All Articles