Q.No.1

What does free() function do in C?

Q.No.2

When should you use malloc() instead of calloc() in C?

Q.No.3

When should you use realloc() function in C?

Q.No.4

How do you free memory allocated by malloc() in C?

Q.No.5

What happens if you try to access memory after freeing it using free() in C?

Q.No.6

Which function allocates memory for an array of structures in C?

Q.No.7

How do you allocate memory for an array of 50 characters using malloc() in C?

Q.No.8

How do you allocate memory for an array of 100 floats initialized to zero using calloc() in C?

Q.No.9

How do you resize a previously allocated memory block to accommodate 30 more doubles using realloc() in C?

Q.No.10

What does realloc() function return if it fails to allocate memory in C?


About Simple Quiz

We're here to make learning fun and accessible. Whether you're a student, teacher, or just someone who loves quizzes, you can find something for you here. Test your knowledge across a wide range of subjects and see how much you know!


Get to know more

Quiz On

Learn about dynamic memory allocation in C programming, including malloc, calloc, realloc, and free functions for managing memory dynamically.

Category

Discover the foundational principles of C programming, ideal for beginners entering the world of coding.


C Programming

Sector

Test your knowledge on the fundamentals of creating software by writing and understanding code in various programming languages.


Programming


Start A Quiz

Do you want to start quiz mode? In this mode, you’ll answer against a timer. When the timer runs out, answers auto-submit, and you get feedback.

Start A Quiz

Do you want to start quiz mode? You'll answer against a timer. When the timer runs out, answers auto-submit