diff --git a/du5/program.c b/du5/program.c index fc0f44a..b68f57e 100644 --- a/du5/program.c +++ b/du5/program.c @@ -2,6 +2,7 @@ #include #include + struct person{ int score; char name[30]; @@ -9,7 +10,7 @@ struct person{ void addElement(struct person* PersonList,int score,char *name){ static int size = 1; - PersonList = realloc(PersonList,size*sizeof(struct person); + PersonList = realloc(PersonList,size*sizeof(struct person)); PersonList[size-1]->score = score; PersonList[size-1]->name = name; size++; @@ -32,7 +33,7 @@ int main(){ int score=0; int c =0; while(scanf("%d %s",&score,name)!=EOF){ - addElement(&PersonList,score,name); + addElement(PersonList,score,name); c++; } @@ -47,11 +48,11 @@ int main(){ idex=0; } } - + int flag=0; printf("Vysledok\n"); for(int i =0;i