且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我应该在哪里调用free()函数?

更新时间:2022-12-29 09:41:10

我会在交流转换器定义一个函数:

I would define a function in A.c:

void freeHead(Head head){
   free(head->Root);
   free(head);
   return;
}

然后在B.c调用它在适当的地方:

Then call it in appropriate places in B.c:

freeHead(head);