🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Pointers and 2D Arrays: all 15 questions

Quiz: Pointers and 2D Arrays · Question 5 of 15

Which function header can receive int marks[10][6]?

Which function header can receive int marks[10][6]?

  1. A.void f(int m[][])
  2. B.void f(int m[][6], int rows)
  3. C.void f(int m[10][])
  4. D.void f(int *m[6])
Answer & explanation

Correct answer: void f(int m[][6], int rows)

Every dimension except the first must be given so the compiler can compute m[i][j]. int *m[6] would be an array of pointers, a different type.

Can you get the rest right without peeking?

Take the timed Quiz: Pointers and 2D Arrays quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →