c pointer, how to free it/them into a function

前端 未结 5 1876
小鲜肉
小鲜肉 2020-12-17 07:02

This is my code:

#include 
#include 
#include 

void getinfo(unsigned int a, unsigned int b, char **pStr);

in         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 07:33

    You don't have to free dynamically allocated memory before exiting. The OS will make all that memory available to the next process.

提交回复
热议问题