C Header Files and Include

[rps-include post=6557]

C header files used to load builtin or third party libraries. Header files provides information about the library, functions, variables, structures etc. provided library.


In order to load library header files we use #include preprocessor. #include preprocessor will load related library definitions before source code is expanded and compiled. All related definitions are inserted into the source code automatically. Include syntax is very simple like below. We write #include and the library name.


In the following example we will load mathematical library by providing the header file name which is math.h

#include <math.h>

Load User Libraries

As previously stated C applications may use builtin or third party libraries. There is a little different while loading differently provided libraries. Following example will look default paths to load library.

#include <math.h>

But following line will look current project path and then default paths to load library. This is used to load user defined libraries.

#include "math.h"

[rps-include post=6557]

LEARN MORE  How To Prevent SQL Injection in Php Applications?

Leave a Comment