What are header files?Header files or Libraries (as they are commonly known as) extends the Languages's functionality..C Language supports only the most basic features that it needs.C language does not even contain functions to read from the keyboard and write to the screen. such extended functionalities are written by programmers and are placed in Header files which are reusable.Header files help you to split up your program into modules.
How to include header files in your program? (only for beginner level)The statement you always write in your c program at the beggining.
yaa.. you are actully including the header files.
we use preprocessor directives or commands which starts with #.
syntax : #include<header file name . h>
why we include header files such as stdio and conio? (conio not for linux)
Most of the C input/output functions are defined in stdio.h.It is a part of the Standard C Library
refer the header file for the list of available functions.the most commonly used are printf,scanf.
conio.h is a C header file used in MS-DOS compilers for performing "console input and output" from a program.It is not a part of the Standard C library.Compilers that target non-DOS operating systems, such as Linux,Win32 do not support this header file.
beside these, the Standard C Library contains a large number of functions for tasks like string handling, mathematical computations, input/output processing, memory allocation and several other operating system services.
If you are using turbo c++ compiler you can see the header files with the function present in that header file in help section.
Here I am providing small list of usefull header files.
math.h it provides many useful functions such as cos,sin...,log,mod,pow etc.
string.h it provides many string handling functions to compare,concatenate strings,to find their length
String functions in C with examples in detail.
malloc/calloc for allocating memories and for memory manegment functions.
stdlib.h this header file has variety of different methods.
stddef.h contains declaration and definitions of default macros and types
bios.h It contains function for basic input /output such as biosdisk bioskey .
graphics.h This header file is useful for drawing 2d objects such as lines, rectangle,oval etc and also filling color .
process.h This header file contains functions such as spawn create and run (executes) other files,known as child process
complex.h this header file contains functions which are required for conversion to complex number from given real and imaginary part.
In short we use header files so that we can use in-built functions.
Want to create your own header files then click here
Share your views regarding the given post via the comments section given below. If you liked the post, please '+1' it & share it on other social networks.