Understanding #include Preprocessor (UIP)

In the previous program example there is a line containing  #include <stdio.h>

#include is a type of preprocessor directive used to tell the compiler to read a file called a header file in the linking process, which is a file that contains function declarations and constant definitions. - The C language provides several header files marked with the .h extension.

For example, in the program above,  #include <stdio.h> it tells the compiler to read the file named  stdio.h when compiling.

General form of #include

#include <namafile> atau
#include "namafile"

The first form  #include <namafile> implies that the file search is performed in a special directory (the include file directory), which is the default directory of title files provided by the programming language.

The second form  #include "namafile" states that the file search is performed first in the active directory where the source program is located, and if it is not found, the search will be continued in other directories according to the commands in the operating system (i.e. PATH).

Most programs involve files  stdio.h, which are standard I/O header files provided in C, which are required for programs that use standard I/O function libraries such as  printf().


Post a Comment

Previous Next

نموذج الاتصال