header files used in C++

 Header files and Comments used in a c++ programmes is described here.

Header files: 
The header files contain the definition of predefined functions that can be directly used in a program.The header files are used thru preprocessor directive (peprocessors are programs that processed before the compilation our source code) #include .

//use the following code in modern compilers

#include <iostream>
using namespace std;

//use the following code while using old turbo c++ compiler with blue screen

eg. #include<conio.h>
      #include<string.h> 
 

Some commonly used header files in a c++ program-----

<math.h>      It is used to perform mathematical operations like sqrt(), pow(), etc.
 
#include <cmath> //modern compiler

<conio.h>     It contains some useful console functions.eg.getch(),getche().

<ctype.h>     It contains function prototypes for functions that test characters for certain properties, and also function prototypes for functions that can be used to convert uppercase letters to lowercase letters and vice versa.

        eg. tolower(),towupper(), isdigit(),isalpha(),islower(),isupper() etc
 
<string.h>   It is used to perform some funcions on strings.
                        eg. strlen(),strcpy(),strcmp() etc.

<iostream.h> It is used as a stream of Input and Output using cout and cin.

<iomanip.h> It is used to access the set() and setprecision() functions to limit the decimal places in variables.

<fstream.h> It is used to control the data to read from a file as an input and data to write into the file as an output.It is used to store , read and process data from a file or to a file.
------------------------------------------------------------------------------------------------------------
Comments :
 
Comments in C++ are used to help the programmer about the variables, conventions and logic used.They are not compiled by the compiler and are not visible to the end users.

There are two ways to use the comments in a programme:

1. Single line comment thru   "//"
 
      // single line comment
     // single line comment
eg.    // a is used for radius
        //formula used is c=a*b+c/100.

2. Multiline comment
     /*     multilple lines or single line followed by */
eg.
 
/*  Iteration means to execute a set of operations n number of times.
Iteration/Looping statements cause statements to be executed zero or more times, based on the conditions mentioned in the loop.
i.e. The body of the loop will execute the number of times the mentioned condition is tested true except the do while loop structure.  */