Computer Science, asked by ashutoshsharma2, 1 year ago

what is header files ?

Answers

Answered by kvnmurty
12
Header files are used by programmers. A header file contains definitions of constants and macro functions or inline functions.

A program can contain symbols and mnemonics that makes a program more generic, readable and understandable.  These symbols are defined in a header file. Then at the top of a program a statement is written to include the header file in this file.  This inclusion is done by a preprocessor or a compiler or interpreter.

Examples: stdio.h,   math.h  

If we want to use IO (input output) functions like printing, reading from keyboard, then we need to include stdio.h.

We can write also a header file named "myhdr.h" , containing for example:

 #define  N  10
#define   M  20

Then we can write inside a program file :
#include  "myhdr.h"

Then we can use the constants N and M inside the program without having to define them.  The advantage is that we can include one header file in many programs, that make use of the constants and functions.


kvnmurty: :-)
prachee2: sir i can't coppied the answer from the google i asked my sister she gave me the answer
prachee2: okay!!!
kvnmurty: you could check it .. it is exactly like that in internet. sorry for hurting you
prachee2: just wait a min.....
prachee2: yess!!!
prachee2: sir,m also sry
Answered by richell
12
for simplest answer.. ..
A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files. There are two types of header files: the files that the programmer writes and the files that comes with your compiler.
Similar questions