C++ examples for Function:main function
Add a Function Prototype before main() function
#include <iostream> #include <string> using namespace std; void printName(string first, string last); int main() //from w ww . j a v a2s .c om { printName("a", "b"); return 0; } void printName(string first, string last) { string fullname = first + " " + last; cout << fullname << endl; }