--:--









Quiz for Dynamic memory allocation realloc

Course: C Language | Subject: Unit 6 | Topic: Pointers



Logo

Q1: What is the primary purpose of realloc() in C?

Logo

Q2: Which header file is required for realloc()?

Logo

Q3: What happens if realloc() fails?

Logo

Q4: If the pointer passed to realloc() is NULL, what happens?

Logo

Q5: If size is zero and ptr is not NULL in realloc(), what happens?

Logo

Q6: Which of the following is a safe way to use realloc()?

Logo

Q7: What is preserved when realloc() changes the memory size?

Logo

Q8: If realloc() moves memory, what happens to the old block?

Logo

Q9: Which is the correct syntax for realloc()?

Logo

Q10: If new size is larger, realloc() will:

Logo

Q11: When should realloc() be used?

Logo

Q12: If realloc() returns NULL, what should be done?

Logo

Q13: What type of pointer does realloc() return?

Logo

Q14: Which of these is NOT true about realloc()?

Logo

Q15: If realloc() is called with size less than original size:

Logo

Q16: Can realloc() be used on memory allocated with calloc()?

Logo

Q17: What is the time complexity of realloc() in worst case?

Logo

Q18: What happens if pointer passed to realloc() was not allocated by malloc/calloc/realloc?

Logo

Q19: Is it necessary to free memory returned by realloc()?

Logo

Q20: Which statement about realloc() is correct?

Are you ready to start test? Set your time limit