C – Library functions
Prev Next
- Library functions in C language are inbuilt functions which are grouped together and placed in a common place called library.
- Each library function in C performs specific operation.
- We can make use of these library functions to get the pre-defined output instead of writing our own code to get those outputs.
- These library functions are created by the persons who designed and created C compilers.
- All C standard library functions are declared in many header files which are saved as file_name.h.
- Actually, function declaration, definition for macros are given in all header files.
- We are including these header files in our C program using “#include<file_name.h>” command to make use of the functions those are declared in the header files.
- When we include header files in our C program using “#include<filename.h>” command, all C code of the header files are included in C program. Then, this C program is compiled by compiler and executed.
- If you want to check source code for all header files, you can check inside “include” directory after C compiler is installed in your machine.
- For example, if you install DevC++ compiler in C directory in your machine, “C:\Dev-Cpp\include” is the path where all header files will be available.
List of most used header files in C:
- Check the below table to know all the C library functions and header files in which they are declared.
| S.No |
Header file
|
Description
|
| 1 | stdio.h | This is standard input/output header file in which Input/Output functions are declared |
| 2 | conio.h | This is console input/output header file |
| 3 | string.h | All string related functions are defined in this header file |
| 4 | stdlib.h | This header file contains general functions used in C programs |
| 5 | math.h | All maths related functions are defined in this header file |
| 6 | time.h | This header file contains time and clock related functions |
| 7 | ctype.h | All character handling functions are defined in this header file |
| 8 | stdarg.h | Variable argument functions are declared in this header file |
| 9 | signal.h | Signal handling functions are declared in this file |
| 10 | setjmp.h | This file contains all jump functions |
| 11 | locale.h | This file contains locale functions |
| 12 | errno.h | Error handling functions are given in this file |
| 13 | assert.h | This contains diagnostics functions |
No comments:
Post a Comment