Access the command-line parameters using a for loop. - C++ Function

C++ examples for Function:main function

Description

Access the command-line parameters using a for loop.

Demo Code

#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;
}

Related Tutorials