xu00wei opened this issue 3 years ago · 1 comments
char* p = malloc(4); strcpy(p, "abc"); // or p = "abc";
这里p = "abc" 实际上会改变指针地址,导致malloc(4)的那个指针地址没了,只能用strcpy。 这个老师在数组部分有提到过。
谢谢指出,已经更正。