#include<stdio.h> void f(char *******p) { char *str1 = "abc"; char *temp = NULL; temp = (char *)malloc(10*sizeof(char)); memset(temp, 0, 10); strcpy(temp, str1); //*temp = 10; *p = temp; } void main() { char ******p1=NULL; char *******p2=NULL; p2 = &p1; f(p2); printf("%s", p1); system("pause"); }
时间: 2024-09-29 11:32:44