C libraries:
The C programming language uses libraries as its primary method of extension. In C, a library is a set of functions contained within a single "archive" file. Each library typically has a header file which contains the prototypes of the functions contained within the library that may be used by a program, and declarations of special data types and macro symbols used with these functions. In order for a program to use a library, it must include the library's header file, and the library must be linked with the program.
The most common C library is the c standard library, which is specified by the ISO and ANSI C standards and comes with every C implementation. This library supports stream input and output, memory allocation, mathematics, character strings, and time values.
What are Header Files in CA header file is a file containing C declarations and macro definitions to be shared between several source files. You request the use of a header file in your program by including it, with the C preprocessing directive `#include'.
Purpose of Header Files
- System header files declare the interfaces to parts of the operating system. You include them in your program to supply the definitions and declarations you need to invoke system calls and libraries.
- Your own header files contain declarations for interfaces between the source files of your program. Each time you have a group of related declarations and macro definitions all or most of which are needed in several different source files, it is a good idea to create a header file for them.
Syntax
The header files are included using the preprocessor directive '#include'.
The header files can be written in two ways:
#include <
file>
- This variant is used for system header files. It searches for a file named file in a standard list of system directories.
#include "
file"
- This variant is used for header files of your own program. It searches for a file named file first in the directory containing the current file, then in the quote directories and then the same directories used for
<
file>
.
- stdio.h - Defines types and macros needed for the standard I/O package.
- conio.h- Declares various functions used in calling the DOS console I/O routines.
- dos.h - Defines various constants and gives declarations needed for DOS.
- math.h- Declares prototypes for the math functions.
- graphics.h-Declares prototypes for the various graphic functions.
Prev NEXT
0 comments:
Post a Comment