Question 5. Command line arguments: show the output [6]
Suppose the program below is compiled to create an executable named myprog,
and we execute the program using the command
./myprog my dataset
Show the precise output the program would produce.
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { for (int i = 0; i < argc; i++) { cout << i << " " << argv[i]; cout << "(" << argv[i][i] << ")"; cout << endl; } } |