diff --git a/cv1/program.c b/cv1/program.c index 074ef37..28c269f 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -10,14 +10,14 @@ struct pizza { float prize; char name[LINESIZE]; }; - +int search_string(const char* heap, const char* needle); int read_pizza(struct pizza* item); char hacker_script(char c); int main(){ struct pizza jedalny_listok[POCET_JEDAL]; memset(jedalny_listok, 0,sizeof(struct pizza)*POCET_JEDAL); - + int counter; char line[LINE_SIZE]; memset(line,0,LINE_SIZE); printf("Zadaj hladanu surovinu:\n"); @@ -25,14 +25,21 @@ int main(){ if(r != NULL && line[1] != 0){ printf("Zadaj jedalny listok\n"); struct pizza item; - int counter = 1; + counter = 1; while(read_pizza(&item)){ - strcpy(jedalny_listok[counter-1].name, item.name); - jedalny_listok[counter-1].prize=item.prize; - counter += 1; - } + strcpy(jedalny_listok[counter-1].name, item.name); + jedalny_listok[counter-1].prize=item.prize; + counter += 1; } } + for(int i=0;i