C Header Files and Include – POFTUT

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.

Include

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

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.

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

[rps-include post=6557]

LEARN MORE  Python Standard Library

Leave a Reply

Your email address will not be published. Required fields are marked *