Header Files in C
Header Files:Header file is nothing but Set of file which we include at the Top while writing our program.Header File Contains inbuilt Functions which is already defined.We include this files for our convenience.We can include header file using preprocessing directive #include like we you have seen inclusion of stdio.h header file,which comes along with your compiler.Header File is included with .h extension which indicate header.
Some Important header Files:
List of Some inbuilt C functions in stdio.h file:
- printf() This function is used to print the character, string, float, integer, octal and hexadecimal values onto the output screen
- scanf() This function is used to read a character, string, numeric data from keyboard.
- getc() It reads character from file
- gets() It reads line from keyboard
- getchar() It reads character from keyboard
- puts()It writes line to o/p screen
1.clrscr():This is the most important function which resides in conio.h file.The purpose of this function is to clear the ouput screen.Whenever Compiler found this function it will clear the whole output screen.We can use this function while Creating Project because lot of time In our project we have to clear the screen.So this can be achieved by using this function.
getch() function in C programming language which waits for any character input from keyboard i.e when the execution of program is completed this function will hold the output screen till any character is entered.We can se say that function is used to hold the output screen.
period of time.It accepts one unsigned integer argument which how much time we have to stop the execution in
2:sound():This function is used to play different sound on different frequency on our system.It takes one integer value as argument which is frequency of sound.By Using different range of frequency we can create a music.
1: ceil():Returns the smallest integer value greater than or equal to x.
2: floor(): Returns the largest integer value less than or equal tox.
3: sqrt(): The C library function double sqrt(double x) returns the square root of x.
Originally published at https://cprogramtutorialfrombasics.blogspot.com.