Use of Preprocessor Directive, using namespace std and main() in C++



Preprocessor Directive :

  • Preprocessor directives begin with a # sign. They are processed before compilation.
  • The "#include" is called a preprocessor directive.
  • The directive "#include <iostream>" tells the preprocessor to include the "iostream" header file to support input/output operations. 

using namespace std; 

The "using namespace std;" statement declares std as the default namespace used in this program. The names cout and endl, which is used in this program belong to the std namespace. These two lines shall be present in all our programs.

main() { ...body ... } 

defines the so-called main() function . The main() function is the entry point of program execution.

First C++ Simple Program to print Hello Word:

First C++ simple program to print Hello word


Post a Comment

0 Comments