回复 9楼 qssssss
简单改了一下你的代码#include <stdio.h>
#include <stdlib.h>
int main()
{
char** fff=NULL;
if ((fff = (char**)calloc(10, sizeof(char*))) == NULL)
{
printf("\n Error: failed in Calloc filegname");
exit(69);
}
int i;
for (i = 0; i < 10; i++)
{
fff[i] = (char *)calloc(2, sizeof(char));
sprintf(fff[i],"%d", i);
}
for (i = 0; i < 10; i++)
{
printf(" %s ", fff[i]);
}
for (i = 0; i < 10; i++)
{
free(fff[i]);
}
free(fff);
fff = NULL;
return 0;
}