五个字符串排序,运行不了,请帮看一下,问题在哪里?
代码如下:#include <stdio.h>
#include<string.h>
void main()
{
char *a[5]={"qw","we","rt","yu","io"};
char **p,**q,**x;
for(p=a;p<=p+3;p++)
for(q=p+1;q<=p+4;q++)
if(strcmp(*p,*q)>0)
{
*x=*p;
*p=*q;
*q=*x;
}
for(int i=0;i<=4;i++)printf("%s\n",*(p+i));
}