Command Line Arguments(C Programming ) Questions and Answers
Explanation:-
Answer: Option A. -> YesUsing the predefined variables _argc, _argv. This is a compiler dependent feature.
It works in TC/TC++ but not in gcc and visual studio.
Question 2.
If the different command line arguments are supplied at different times would the
output of the following program change?
#include<stdio.h>
int main(int argc, char **argv)
{
printf("%d\n", argv[argc]);
return 0;
}
- Yes
- No
Explanation:-
Answer: Option B. -> No
Explanation:-
Answer: Option A. -> YesYes you have to compile a program like
tcc myprog wildargs.obj
Explanation:-
Answer: Option B. -> False
Explanation:-
Answer: Option A. -> True
Explanation:-
Answer: Option A. -> It is an array of character pointers
Explanation:-
Answer: Option B. -> False
Explanation:-
Answer: Option C. -> In place of ac and av, argc and argv should be used.
Explanation:-
Answer: Option C. -> myprog 10 20 30
Explanation:-
Answer: Option B. -> 65519 65521