You are on page 1of 1

//FILE B TO SORT ARRAY OF STRINGS//

extern char s[30][30];


extern int n;
void sort()
{
int i,j;

char temp[30];

for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(strcmp(s[j],s[i])<0)
{
strcpy(temp,s[i]);
strcpy(s[i],s[j]);
strcpy(s[j],temp);
}//end if
}//end inner for
}//end outer for
}//end sort

You might also like