Difficulty: Easy
Correct Answer: argv is a pointer to a char pointer.
Explanation:
Introduction / Context:
Understanding multi-level pointers is essential in C, especially for command-line arguments and arrays of strings. The identifier argv is widely used in main's formal parameter list as char *argv, representing an array of C strings where each element is a char and the array itself is addressed via a pointer to pointer to char.
Given Data / Assumptions:
Concept / Approach:
char* means “pointer to char”. Adding another * yields char** which means “pointer to pointer to char”. This is commonly used for an array-of-pointers representation of strings, where argv points to the first element of an array of char* values, each of which points to the first character of a NUL-terminated string.
Step-by-Step Solution:
Verification / Alternative check:
Indexing argv like argv[i] produces type char*, and dereferencing once *argv[i] yields char, consistent with a list of strings. This aligns with the standard practice of treating argv as an array of pointers to C strings.
Why Other Options Are Wrong:
Pointer to pointer — Too vague; it does not specify the base type char.
Function pointer — No function declarator () is present.
Member of function pointer — Nonsensical in C terminology.
Common Pitfalls:
Final Answer:
argv is a pointer to a char pointer.
Discussion & Comments