C++ examples for Function:main function
Print the arguments to the program to the standard output
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { cout << "The arguments to " << pszArgs[0] << " are:\n"; for (int i = 1; i < nNumberofArgs; i++) {// w ww. j ava 2s .c o m cout << i << ":" << pszArgs[i] << "\n"; } cout << "That's it" << endl; return 0; }