int size_of_daten = 5;
char *data[size_of_daten];
char *normal_Pointer = (char*)malloc(sizeof(char) * 100);
int i;
for(i=0; i<size_of_daten; i++) {
data[i] = (char*)malloc(sizeof(char) * 100);
}
data[0] = "0";
data[1] = "1";
data[2] = "2";
data[3] = "3";
data[4] = "4";
printf("data[2] %s\n",data[2]);
strcpy(normal_Pointer,data[2]);
for(i=0; i<size_of_daten; i++) {
free(data[i]);
}
free(data);
我刚试过这个......即使我在分配数组时释放了它......我也复制了它的值data[2]
并且没有指向它......所以这不应该是问题......