C++ examples for Function:main function
Display command-line arguments
#include <iostream> using namespace std; int main(int argc, char *argv[]) { int i;/* www. j a v a 2 s. com*/ cout << "\nThe following arguments were passed to main(): "; for (i = 0; i < argc; i++) cout << argv[i] << " "; cout << endl; return 0; }