C++ examples for Function:main function
Access the command-line parameters using a for loop.
#include <iostream> using namespace std; int main(int argc, char *argv[]) { for (int index=0; index < argc; index++) {//w ww. ja va 2 s .c o m cout << argv[index] << endl; } return 0; }