Memory Allocation MCQs

62 questionsC-ProgramPage 2 of 7

Practice free Memory Allocation multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 62 questions — no login required.

Question 10easy
What is a memory leak in C?
Question 11easy
What is the purpose of the 'free' function in C?
Question 12medium
How do you check if the 'malloc' function has successfully allocated memory in C?
Advertisement
Question 13medium
Which function is used to return the number of bytes allocated by 'malloc'?
Question 14easy
What is the return value of the 'realloc' function if it fails to reallocate memory?
Question 15easy
In C, what is the purpose of the 'calloc' function?
Advertisement
Question 16medium
What does the 'sizeof' operator in C return for a dynamically allocated array?
Question 17medium
Which function is used to allocate memory for an array of character strings in C?
Question 18easy
What is a segmentation fault in C?