Yes / No Questions

Question 1 :

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
Answer : Option A

Explanation :

Yes you have to compile a program like
tcc myprog wildargs.obj


Question 2 :

If the different command line arguments are supplied at different times would the output of the following program change?

#include
int main(int argc, char **argv)
{
    printf("%d\n", argv[argc]);
    return 0;
}


A). Yes
B). No
Answer : Option B

Question 3 :

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
Answer : Option A

Explanation :

Using the predefined variables _argc, _argv. This is a compiler dependent feature. It works in TC/TC++ but not in gcc and visual studio.