Assume the following C variable declaration: int *A[10], B[10][10]; Among the…

2018

Assume the following C variable declaration: int *A[10], B[10][10]; Among the following expressions, which will not give compile-time errors if used as the left-hand side of assignment statements in a C program? I. A[2] II. A[2][3] III. B[1] IV. B[2][3]

  1. A.

    I, II and IV only

  2. B.

    II, III and IV only

  3. C.

    II and IV only

  4. D.

    IV only

Attempted by 182 students.

Show answer & explanation

Correct answer: A

A[2] — type: int* (element of the array of pointers). This is an lvalue and can be assigned (for example: A[2] = ptr;).

Explore the full course: Up Lt Grade Assistant Teacher 2025