Skills101
← All practice quizzes

Quiz: Pointers and 2D Arrays

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

How a 2D array sits in memory, what a[i][j] really means, the difference between int *p[3] and int (*p)[3], passing matrices to functions, and building a matrix with malloc.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    For int m[3][5];, at what position (counting from 0) in memory is m[2][3]?

  2. Question 2

    What does this print?

    #include <stdio.h>
    int main(void) {
        int m[2][3] = {{1, 2, 3}, {4, 5, 6}};
        printf("%d", *(*(m + 1) + 2));
        return 0;
    }
    
  3. Question 3

    What is int *p[4];?

  4. Question 4

    With 4-byte ints and int m[3][4];, how many bytes apart are m and m + 1?

  5. Question 5

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

🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →