// dump_args.cpp: display all command line arguments in C++ // Compiles using nearly any post-2000 version of C++. #include #include using namespace std; int main(int argc, char* argv[]) { if ( argc == 0 ) cout << "No command-line arguments." << endl; else { for(int i = 0; i < argc; ++i) cout << setw(3) << i << ": " << argv[i] << endl; } return 0; }