Difficulty: Medium
Correct Answer: u
Explanation:
Introduction / Context:
The expression ++argv[2] combines array indexing, prefix increment, and dereferencing on a pointer to char. Understanding operator precedence and the effect of incrementing a char is crucial.
Given Data / Assumptions:
Concept / Approach:
[] binds more tightly than ++, so we first get argv[2] (a char), then apply prefix ++ to move within the string, and finally use * to read the character now pointed to.
Step-by-Step Solution:
Verification / Alternative check:
Assign char *p = argv[2]; ++p; putchar(*p); to observe the same result without compact operators.
Why Other Options Are Wrong:
Common Pitfalls:
Misinterpreting ++argv[2] as ++argv then [2]; forgetting pre-increment advances before dereference.
Final Answer:
u
Discussion & Comments