// print-args.cpp: prints command line arguments to cout // Build with g++ -std=c++14 print-args.cpp #include using namespace std; int main(int argc, char **argv) { // argv[0] is the name of the command cout << "Command: " << argv[0] << endl; // print the remaining arguments: for(int i = 1; i < argc; ++i) cout << "Argument " << i << ": " << argv[i] << endl; return 0; }