How to implement the following code to a structure?

0

The code I did, simply asks me for two words, then compares them and shows me in the order that goes.

if(strcmp(palabra1,palabra2)>0){
    printf("En Orden: \n");
    printf("1- %s\n2- %s",palabra2,palabra1);
}
else{
    printf("En Orden: \n");
    printf("1- %s\n2- %s",palabra1,palabra2);
}
return 0;

My question is, how would you implement it to my structure?

struct cliente
{
       int documento;
       char nombre[15];
       char apellido[15];
       char telefono[20];
       int ocupacion;
};

To order it alphabetically! Thanks.

    
asked by Pedro Antonio Obregon Alomia 27.11.2016 в 19:30
source

0 answers