C Programming - Command Line Arguments
Exercise : Command Line Arguments - Yes / No Questions
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?
Answer: Option
Explanation:
Yes you have to compile a program like
tcc myprog wildargs.obj
tcc myprog wildargs.obj
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;
}
3.
Does there exist any way to make the command-line arguments available to other functions without passing them as arguments to the function?
Answer: Option
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.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers