v3
This commit is contained in:
parent
6d745dc623
commit
62a4fabcf9
@ -21,7 +21,7 @@ int main(){
|
|||||||
char sign[] = {'o','i','z','e','a','s','b','t','b','q'};
|
char sign[] = {'o','i','z','e','a','s','b','t','b','q'};
|
||||||
char secret[]={'0','1','2','3','4','5','6','7','8','9'};
|
char secret[]={'0','1','2','3','4','5','6','7','8','9'};
|
||||||
|
|
||||||
char input_search[20];
|
char input_search[50];
|
||||||
//initialize input_search
|
//initialize input_search
|
||||||
struct item menu[NUMBER_OF_MEALS];
|
struct item menu[NUMBER_OF_MEALS];
|
||||||
struct backup_item backup_menu[NUMBER_OF_MEALS];
|
struct backup_item backup_menu[NUMBER_OF_MEALS];
|
||||||
@ -34,7 +34,7 @@ int main(){
|
|||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
printf("Zadaj hladanu surovinu: ");
|
printf("Zadaj hladanu surovinu:\n");
|
||||||
fgets (input_search, 20, stdin);
|
fgets (input_search, 20, stdin);
|
||||||
|
|
||||||
printf("Zadaj jedalny listok:\n");
|
printf("Zadaj jedalny listok:\n");
|
||||||
@ -43,19 +43,22 @@ int main(){
|
|||||||
//initialize temp
|
//initialize temp
|
||||||
int meal_counter = 0;
|
int meal_counter = 0;
|
||||||
//load menu
|
//load menu
|
||||||
|
char* ptr = NULL;
|
||||||
while(1){
|
while(1){
|
||||||
fgets (menu[meal_counter].name, 20, stdin);
|
ptr = fgets (menu[meal_counter].name, 20, stdin);
|
||||||
|
if(ptr == NULL){
|
||||||
|
break;
|
||||||
|
}
|
||||||
if(menu[meal_counter].name[0] == '\n'){
|
if(menu[meal_counter].name[0] == '\n'){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fgets (temp, 10, stdin);
|
fgets (temp, 20, stdin);
|
||||||
menu[meal_counter].price = strtof(temp, NULL);
|
menu[meal_counter].price = strtof(temp, NULL);
|
||||||
|
|
||||||
|
|
||||||
meal_counter++;
|
meal_counter++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//make copy of menu
|
//make copy of menu
|
||||||
for (int i = 0 ; i < meal_counter; i++){
|
for (int i = 0 ; i < meal_counter; i++){
|
||||||
strcpy(backup_menu[i].name, menu[i].name);
|
strcpy(backup_menu[i].name, menu[i].name);
|
||||||
|
Loading…
Reference in New Issue
Block a user