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.