#include <stdio.h>
#include <string.h>
void bubblesort(int n, char *ptr[]){
    char *tmp;
    for (int i = 0; i < n; i++){    
        for (int j = 0 ; j < n; j++){
            if(strcmp(*(ptr+i) , *(ptr+j))>0){
                strcpy(tmp , *(ptr+i));
                strcpy(*(ptr+i) , *(ptr+j));
                strcpy(*(ptr+j) , tmp);
            }
        }
    }
     //printf("\n",ptr+0,ptr+1,ptr+2,ptr+3,ptr+4,ptr+5,ptr+6,ptr+7,ptr+8,ptr+9); **<= without this line my code doesn't executive**
}
int main()
{
    int n;
    scanf("%d\n", &n);
    char str[10][20];
    for (int i = 0; i < n; i++)
 gets(str[i]);
    char *ptr[10];
    for (int i = 0; i < n; i++)
        ptr[i] = str[i];
    bubblesort(n, ptr);
    for (int i = 0; i < n; i++)
        puts(ptr[i]);
}
C:\Users\kk\Desktop\C>a 10 banana kiwi apple tomato lemon melon pear blueberry strawberry orange
tomato strawberry pear orange melon lemon kiwi blueberry banana apple
C:\Users\kk\Desktop\C>
with out above line
C:\Users\kk\Desktop\C>a 10 banana kiwi apple tomato lemon melon pear blueberry strawberry orange
C:\Users\kk\Desktop\C> `
 
     
    