Freeing char* memory in struct without losing the string

前端 未结 0 1871
失恋的感觉
失恋的感觉 2020-12-07 00:59

I assign a string in my structs like this:

struct REC {
    char *name;
    char *number;
};

records[records_size - 1].name = NAME;
records[records_size - 1]         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题