C++ Tutorial/Language Basics/main function
A C++ program begins at main()
#include <iostream>
using namespace std;
int main()
{
cout << "www.java2s.com";
return 0;
}
www.java2s.com"
Call a function in main
#include <iostream>
void DemonstrationFunction()
{
std::cout << "In Demonstration Function\n";
}
int main()
{
std::cout << "In main\n" ;
DemonstrationFunction();
std::cout << "Back in main\n";
return 0;
}
In main In Demonstration Function Back in main