Multiple choice

Assume the following C variable declaration

int * A[10], B[10][10]; of the following expressions

I. A[2]
II. A[2][3]
III. B[1] IV. B[2][3]

Which will not give compile-time errors if used as left hand sides of assignment statements in a C program?

  1. I,II, and IV only

  2. II, III, and IV only

  3. II and IV only

  4. IV only

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation
int main(){
    int *A[10], B[10][10];
    int c[] = {12, 11, 13, 14};

   A[2] = C;

   A[2][3] = 15;

   B[2][3] = 15;

   printf("%d %d', A[2][0], A[2][3]);
   getchar();
}