Difficulty: Easy
Correct Answer: memory address
Explanation:
Introduction / Context:
Arrays are contiguous sequences of elements in memory. Understanding how an array name behaves in expressions is crucial for pointer arithmetic, parameter passing, and avoiding common errors. Many exam questions capture this by asking what an array name denotes at run time or during expression evaluation.
Given Data / Assumptions:
Concept / Approach:
In most expressions, the array name decays to a pointer to its first element; conceptually, it evaluates to the memory address where the array begins. Although the array itself is not a modifiable lvalue pointer, the practical takeaway is that the array name provides the base address, enabling operations like a[i] = *(a + i). Thus, among the options given, “memory address” best captures the behavior.
Step-by-Step Solution:
Recognize array-to-pointer decay: a (array) becomes &a[0] in expressions.Interpret &a[0] as the base memory address of the first element.Relate indexing to pointer arithmetic: a[i] equals *(a + i).Conclude the array name provides a memory address used for access.
Verification / Alternative check:
Print a and &a[0] with %p in C and observe identical addresses (implementation-defined formatting), confirming that the array name evaluates to its base address in expressions.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming the array name is a modifiable pointer variable; it is not. You cannot increment the array name itself, though you can manipulate separate pointer variables.
Final Answer:
memory address.
Discussion & Comments