if (namelist==NULL)
{
namelist=(char**)malloc(sizeof(char**));
namelist[i]=name;
}
else
{
namelist=(char**)realloc(namelist,(i+1)*sizeof(char**));
namelist[i]=name;
}
for(i=0;i<count;i++)
{
printf("%s\t\t%s\n",namelist[i],namelist[i]);
}
问题是如果我输入"abcdefg"
,作为输入"abcdefgh"
,"abc"
我会得到
abcdefg abcdefg
abcdefgh abcdefgh
abc abc
有没有办法让第二个和"abcdefgh"
第二个一样排队?"abcdefg"
"abc"