Im trying to make a program that will sort the the list according to its cost...from least to expensive...
here's my code:
#include <stdio.h>
#include <string.h>
typedef struct resto RESTO;
struct resto{
char *name;
char *address;
float cost;
char *food;
};
void output(RESTO r1);
int main()
{
RESTO r1= {"Coras","Agora",60,"BBQ"};
RESTO r2= {"Panagatan","Opol",120,"BBQ"};
RESTO r3= {"Max","Divisoria",70,"BBQ"};
RESTO r4= {"XU Resto","Bukid",1200,"BBQ"};
RESTO r5= {"Hubo2x","Eng'g Bldg. XU",6000,"BBQ"};
RESTO *ptr_r1 = &r1;
output(r1;
getchar();
getchar();
}
void output(RESTO r1)
{
printf("\n");
printf("Name: %s\n"
"Addr: %s\n"
"Cost: %.2f\n"
}
can u help me with this pls?