Whenever freeing the structured element (which in turn contains the pointer to dynamically allocated memory location), first traverse to the child memory location and start freeing from there, traversing back to the parent node.

 
  • 当释放结构体成员的内存时(这个结构体有成员指针指向动态分配的内存),要先把子内存区域释放掉,再释放父内存区域。
今日热词
目录 附录 查词历史