C Programming - Command Line Arguments - Discussion
Discussion Forum : Command Line Arguments - Point Out Correct Statements (Q.No. 1)
1.
Which of the following is TRUE about argv?
Discussion:
5 comments Page 1 of 1.
Shweta Dubey said:
1 decade ago
The answer of this question is B, as argv is a pointer to an array of pointer to strings.It is used as double pointer in the argument of main() mean it is a pointer to a pointer.
Vikas said:
1 decade ago
@shweta yes you are right.
Raj Naik said:
1 decade ago
@shweta @vikas: yeah you both are right.
Usha said:
1 decade ago
Hey option A is right yar because *argv[] means argv[] behaves like a array of character so *argv[] = it is an array of character pointer.
Mangusta said:
1 decade ago
The answer is not B, because declaration of pointer to array of character pointers will look like:
char * (*argv)[some size];
Inside of main, "argv" is a pointer to a pointer to character,
or in other words, a pointer to string, it is more than just "array", because we can perform arithmetic operations on it.
For example, ++argv or --argv are legal statements for argv.
char * (*argv)[some size];
Inside of main, "argv" is a pointer to a pointer to character,
or in other words, a pointer to string, it is more than just "array", because we can perform arithmetic operations on it.
For example, ++argv or --argv are legal statements for argv.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers