Command Line Arguments
- What will be the output of the following C statement? (assuming the input is “Welcome to Interview mania”)
printf(“%s\n”, argv[argc]);
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
(null)
- What is argv[0] in command line arguments?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The name by which the program was invoked
- What is the second argument in command line arguments?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
A pointer to an array of character strings that contain the arguments, one per string
- What is the first argument in command line arguments?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The number of command-line arguments the program was invoked with;
- In linux, argv[0] by command-line argument can be occupied by _________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
In linux, argv[0] by command-line argument can be occupied by ./test, ./fun.out.out and ./a.out