Exercise: Command Line Arguments

Questions for: Command Line Arguments

Does there exist any way to make the command-line arguments available to other functions without passing them as arguments to the function?
A:
Yes
B:
No
C:
D:
Answer: A
Using the predefined variables _argc, _argv. This is a compiler dependent feature. It works in TC/TC++ but not in gcc and visual studio.
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;
}
A:
Yes
B:
No
C:
D:
Answer: B
No answer description is available. Let's discuss.
In Turbo C/C++ under DOS if we want that any wild card characters in the command-line arguments should be appropriately expanded, are we required to make any special provision?
A:
Yes
B:
No
C:
D:
Answer: A
Yes you have to compile a program like
tcc myprog wildargs.obj
The first argument to be supplied at command-line must always be count of total arguments.
A:
True
B:
False
C:
D:
Answer: B
No answer description is available. Let's discuss.
Even if integer/float arguments are supplied at command prompt they are treated as strings.
A:
True
B:
False
C:
D:
Answer: A
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz