求高人指点,哪里出错了,怎么调试呢
#include<stdio.h>#include<string.h>
#include<stdlib.h>
void AlphaSort(char *array[],int size)
{
//char abx[4];
//char *temp=(char*)malloc(sizeof(char)*100);
char *temp;
int i,j,c;
for(j=0;j<size;j++)
{
for(i=0;i<j;i++)
{
if(strcmp(array[i],array[i+1])>0)
{
strcpy(temp,array[i]);
strcpy(array[i],array[i+1]);
strcpy(array[i+1],temp);
}
}
}
for(c=0;c<size;c++)
printf("%s\n",array[c]);
}
int main(){
char *ab[]={"fuck","ding","li","yuan"};
AlphaSort(ab,4);
}