Basic Malloc/Free

前端 未结 5 539
谎友^
谎友^ 2021-01-20 18:50

If I have a snippit of my program like this:

struct Node *node;
while(...){
    node = malloc(100);
    //do stuff with node
}

This means t

5条回答
  •  执笔经年
    2021-01-20 19:41

    You can not. You need to store all the pointer to free the memory. if you are saving those pointer somewhere then only you can free the memory.

提交回复
热议问题