Skills101
← All practice quizzes

Quiz: Dynamic Memory

5 questionsNo time limitPass: 60%+10 XP on first pass

Ask for memory while the program runs. malloc vs calloc, growing arrays with realloc, freeing memory, leaks and dangling pointers — and building a linked list.

Log in to take the quiz

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

  1. Question 1

    Which function allocates memory AND sets it to zero?

  2. Question 2

    What is a memory leak?

  3. Question 3

    What is the correct way to allocate an array of 10 ints?

  4. Question 4

    After free(p);, what should you do to avoid a dangling pointer?

  5. Question 5

    Which header declares malloc and free?