diff --git a/cv1/program.c b/cv1/program.c index 9cdabe3..074ef37 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -5,7 +5,7 @@ #define LINESIZE 100 #define LINE_SIZE 100 - +#define POCET_JEDAL 100 struct pizza { float prize; char name[LINESIZE]; @@ -14,20 +14,22 @@ struct pizza { int read_pizza(struct pizza* item); char hacker_script(char c); int main(){ - int POCET_JEDAL=0; + struct pizza jedalny_listok[POCET_JEDAL]; memset(jedalny_listok, 0,sizeof(struct pizza)*POCET_JEDAL); char line[LINE_SIZE]; memset(line,0,LINE_SIZE); + printf("Zadaj hladanu surovinu:\n"); char* r = fgets(line,LINE_SIZE,stdin); if(r != NULL && line[1] != 0){ + printf("Zadaj jedalny listok\n"); struct pizza item; int counter = 1; while(read_pizza(&item)){ + strcpy(jedalny_listok[counter-1].name, item.name); + jedalny_listok[counter-1].prize=item.prize; counter += 1; - printf("%s",item.name); - printf("%.2f\n",item.prize); } } } diff --git a/cv1/program.exe b/cv1/program.exe index 1bdbff6..1e2b96c 100644 Binary files a/cv1/program.exe and b/cv1/program.exe differ