11. What is the purpose of the 'free' function in C? A. To deallocate dynamically allocated memory B. To allocate memory C. To copy memory D. To check for memory leaks Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
12. How do you check if the 'malloc' function has successfully allocated memory in C? A. Check if the return value is not NULL B. Check if the return value is 1 C. Check if the return value is -1 D. Check if the return value is 0 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
13. Which function is used to return the number of bytes allocated by 'malloc'? A. malloc_size() B. sizeofmalloc() C. size() D. malloc_bytes() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
14. What is the return value of the 'realloc' function if it fails to reallocate memory? A. NULL B. -1 C. 0 D. 1 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
15. In C, what is the purpose of the 'calloc' function? A. To allocate and initialize a block of memory B. To deallocate memory C. To copy memory D. To check for memory leaks Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
16. What does the 'sizeof' operator in C return for a dynamically allocated array? A. Size of a single element B. Size of the entire array C. Size of the pointer D. Size of the first element Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
17. Which function is used to allocate memory for an array of character strings in C? A. malloc() B. calloc() C. alloc() D. stralloc() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
18. What is a segmentation fault in C? A. An error that occurs when accessing an invalid memory location B. An error in memory allocation C. An error when allocating a string D. An error in file I/O Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
19. How do you check if the 'realloc' function has successfully reallocated memory in C? A. Check if the return value is not NULL B. Check if the return value is 1 C. Check if the return value is -1 D. Check if the return value is 0 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
20. Which function is used to free allocated memory but does not remove the pointer in C? A. clear() B. free() C. release() D. deallocate() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board