chownn
获得 100 次赞
帮助过306人
下面代码中,p申请内存,把p的指针赋给p1,此时释放free(p1),p申请的内存释放释放了?怎么理解?void main(){ char *s = "Hello World"; printf("%s\r\n"s); unsigned char *p = (unsigned char *)malloc(20); memset(p020); memcpy(ps15); printf("%s\r\n"p); unsigned char *p1 = p; printf("befor free p1%s\r\n"p); free(p1); p1 = NULL; printf("end free p1%s\r\n"p); free(p); printf("end free p%s\r\n"p); }