CPP Language / CPP Program Structure

CPP Program Structure
C++ Headers
C++ Class Definitions
Member Functions Definition
Main Function

Example CPP Program
Program Output

/* C++ Program Example*/
#include
using namespace std;
int main()
{
cout<<"Wisdom Materials";
return 0;
}

Wisdom Materials


Explanation
/* First C++ Program */ /*...*/ comments are used for documentation to understand the code to others and are ignored by the compiler.
#include<iostream> It is a preprocessor directive and used for input output statements.
int/void Integer (int) returns a value.

main() Here the program execution starts.
Curly Braces {...} It is used to group all statements together.
std::cout It is used to print a statement in the console / terminal.
Wisdom Materials"; Output of the above program
<< It is the insertion stream operator. This operator sends the content of variables on its right to the object on its left.


Home     Back