Asked in
Computer Programming
Java Programming
C Programming

Write a program which uses Command Line Arguments?

Answer

User Avatar
Wiki User
August 25, 2008 4:57AM

IN C++

#include <iostream> int main(int argc, char *argv[]) { using namespace std; cout << "There are " << argc << " arguments:" << endl; // Loop through each argument and print its number and value for (int nArg=0; nArg < argc; nArg++) cout << nArg << " " << argv[nArg] << endl; return 0; }