The subscript expression a[i] is defined as equivalent to which form?
-
A
a + i
-
B
*(a + i)
Correct answer
-
C
*(a + i * 4)
-
D
&a[i]
Correct answer
B. *(a + i)
15 views
Explanation
The standard defines a[i] as *(a + i), since pointer arithmetic already scales by the element size.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ