Question:
what are header (“#include”) files searched for?
?
2012-02-22 02:40:29 UTC
c language
Six answers:
anonymous
2012-02-22 02:47:04 UTC
I assume you mean used for, and they are used for telling the preprocessor that you will be using code from those sources.
Will H
2012-02-22 02:45:41 UTC
The #include directive tells the preprocessor to treat the contents of a specified file as if those contents had appeared in the source program at the point where the directive appears. You can organize constant and macro definitions into include files and then use #include directives to add these definitions to any source file. Include files are also useful for incorporating declarations of external variables and complex data types. You need to define and name the types only once in an include file created for that purpose.
Sean
2012-02-22 02:45:33 UTC
include is literally taking the contents of the file specified and copying it into that location of the source code before compiling.



They are used for things such as storing forward declarations of functions and constant values. They are primarily used to tell the compiler that the definitions of functions you wish to use are located in a different file and will be linked with the program.
jplatt39
2012-02-22 03:11:52 UTC
Header files are searched for variables, types like size_t, and declarations of functions which are implemented in the libraries.
anonymous
2012-02-22 02:48:26 UTC
On a normal Unix system, if you do not instruct it otherwise,

[GCC] will look for headers requested with #include in:



/usr/local/include

libdir/gcc/target/version/include

/usr/target/include

/usr/include



For C++ programs, it will also look in /usr/include/g++-v3, first.
anonymous
2012-02-23 04:35:09 UTC
It is main part of any programming language. (“#include”) it is used to include any library in your Program.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...