Thursday, March 19, 2009

Tutorial: Learn All The Basics Of C++ Language :page 4

HEADER FILES


Header files as the name suggest are the head of the program and are written outside the main body. These files contain commands to run codes like cin>>, cout<<, getch (); clrscr (); etc... The files we are going to learn here are. #include : The main header file has the commands to run commands like clrscr(); and getch();
#include : This header file has codes to run cin>> & cout<<. #include : This header file has a function called gets which is used as same as cin>> but it is mainly used for entering character and it reads spaces bt. Character while cin>> doesn’t read spaces in character .

For E.g.:- cin>>name;

Suppose user had entered Tech Enclave
Then cout< will give the output Tech
While gets(name); will give same output as the name entered.
Also clrscr(); means Clear the screen if this does not given then the output of previously opened will also come along the output of your current program output.
getch(); is the command to give a pause to the console output screen , if not entered then the output will be shown but if u will enter any value the screen will return to the coding window.
Ahhhhhhhh…. Now I have completed the theory part Hope every one understood it if not ask without any hesitation. Let’s start the main Programming part.

No comments:

Post a Comment