摘要: char* GerMemory(void){ char p[] = "hello world"; return p;} void Test(void){ char* str = NULL; str = GerMemory(); printf(str);} int main() { Test(); r 阅读全文
posted @ 2022-05-09 22:28 藏进夜里躲在光下 阅读(43) 评论(0) 推荐(0)
摘要: //常见错误, //1.对NULL指针的解引用操作 //int* p = malloc(40); //*p = 10;//mallco开辟空间失败,-对NULL指针解引用,需要对p进行判断 //2.对动态开辟内存空间的越界访问 //3.对非动态开辟内存使用free释放 //4.使用free释放动态内 阅读全文
posted @ 2022-05-09 22:07 藏进夜里躲在光下 阅读(55) 评论(0) 推荐(0)