top of page

First C++ program

  • Writer: -A
    -A
  • Jan 25, 2020
  • 1 min read

  1. Header files are included at the beginning just like in C program. Here iostream is a header file which provides us with input & output streams. Header files contained predeclared function libraries, which can be used by users for their ease.

  2. Using namespace std, tells the compiler to use standard namespace. Namespace collects identifiers used for class, object and variables. NameSpace can be used by two ways in a program, either by the use of using statement at the beginning, like we did in above mentioned program or by using name of namespace as prefix before the identifier with scope resolution (::) operator. Example: std::cout << "A";

  3. main(), is the function which holds the executing part of program its return type is int.

  4. cout <<, is used to print anything on screen, same as printf in C language. cin and cout are same as scanf and printf, only difference is that you do not need to mention format specifiers like, %d for int etc, in cout & cin.

ree

Comments


Post: Blog2_Post

Subscribe Form

Thanks for submitting!

  • Instagram
  • Facebook

©2020 by C++ Programming. Proudly created with Wix.com

bottom of page