Wednesday, 5 September 2018

About Header Files and Functions

                                  About Header Files

In c and c++ language any file which have the extension .h is called as a headerfile. These header file are developed by the company which design the compiler or IDEs of C language and they contain a huge collection of predefined programs called as functions.

Methamatical functions are-
-sqrt()
-pow()
-sin()
-cos()
-pan()
-log()
These all are available in a headerfile called math.h

Graphics related functions are-
-circle()
-rectangle()
-bar()
-polygon()
These all are available in the headerfile called graphics.h

Uses-

Now whenever we write a programme in C language , we can use these functions to make our task simpler . But before using any predefine functions in our programme we must compulsaryly attached the require header file using the command -
#include

What is stdio.h and why do we use it?

stdio = standard input-output

standard input means keyboard and standard output means monitor. Thus the headerfile stdio.h provides us support for keyboard and monitor in our programmes . This support is given in the form of two functions printf() and scanf().

printf() = used for displaying text on monitor called as output.
scanf() = used for accepting values from the user called as input.

What is conio.h and why do we use it?

conio = console input-output

console represent output window that is the window ware the result of execution of our programme is displayed.
Although the headerfile conio.h does not produce this window but it provides us some very useful functions  to manage the window some of it importance functions are -
1. clrscr() = used for cleaning the console window.
2. textcolor() = used for changing font colour of the console window.
3. gotoxy() = used for setting cursor position on console window.
4. getch() = used for pausing the console window.







2 comments: