c语言从键盘任意输入5个字符串,请按字典排序后,再输出。

从键盘任意输入5个字符串,请按字典排序后,再输出。要求:排序功能用子函数sortSring(char *p,int n)实现

如果是这个isortSring(char **p,int n)可以写追问

请编程序

追答

调试出来了你看看
#include
#include
#include
void show(char* a[],int size)
{ printf("show the string \n");
int i;
for(i=0;i0)
{
temp=b[i];
b[i]=b[j];
b[j]=temp;
}
}
}
}
int main()
{
const int size=5;
char* a[size];
int i;
for(i=0;i<size;i++)
{ char *p=(char *)malloc(sizeof(int)*100);
printf("please input the %d string:",i+1);
scanf("%s",p);
a[i]=p;
}
show(a,size);
paixu(a,size);
show(a,size);
return 0;
}

温馨提示:答案为网友推荐,仅供参考
相似回答