RejinpaulPlacement
Search

Command Line Arguments - C Programming Questions and Answers - RejinpaulPlacement

@ : Home > C Programming > Command Line Arguments


Find us on Facebook



Follow us on Google+


Google+

1.
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
Answer & Solution
Answer: (D) It may vary from one operating system to another
Solution:
No answer description available for this question. Let us discuss.
close
2.
According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
Answer & Solution
Answer: (D) int main(int argc, char *argv[])
Solution:
No answer description available for this question. Let us discuss.
close
3.
What do the 'c' and 'v' in argv stands for?
Answer & Solution
Answer: (C) 'c' means argument count 'v' means argument vector
Solution:
No answer description available for this question. Let us discuss. close
4.
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three

/* myprog.c */
#include
int main(int argc, char **argv)
{
printf("%c\n", **++argv);
return 0;
}
Answer & Solution
Answer: (C) o
Solution:
No answer description available for this question. Let us discuss.
close
5.
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three

/* myprog.c */
#include
#include
int main(int argc, char **argv)
{
printf("%s\n", *++argv);
return 0;
}
Answer & Solution
Answer: (B) one
Solution:
No answer description available for this question. Let us discuss.
close