Discussion
How do you free allocated memory?
Answer: B
Correct answer: free(var-name);
free() returns memory obtained from malloc, calloc or realloc to the heap. delete is the C++ operator, and the other two names do not exist. Freeing the same block twice, or using a pointer after freeing it, is undefined behaviour.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development