Last active
January 7, 2020 16:28
-
-
Save enesusta/f6c0bdaaa1383c504d2b2f11c2aa467d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct Student { | |
char name[20]; | |
int noteOne; | |
int noteTwo; | |
int noteThree; | |
int noteFour; | |
int noteFive; | |
} Student; | |
void viewAllStudents(struct Student **); | |
int main() { | |
struct Student **students = (struct Student**) malloc(50 * sizeof(struct Student)); // 50 ogrencilik alan tahsis ettik | |
int i; | |
char buffer[20]; | |
int noteOne,noteTwo,noteThree,noteFour,noteFive; | |
for ( i = 0; i < 50 ; i++) { | |
students[i] = (struct Student*) malloc(sizeof(struct Student)); | |
printf("Ogrencinin ismini girin: "); | |
scanf("%s", &buffer); | |
strcpy(students[i]->name, buffer); | |
printf("\nOgrencinin birinci notunu girin: "); | |
scanf("%d",¬eOne); | |
students[i]->noteOne=noteOne; | |
printf("\nOgrencinin ikinci notunu girin: "); | |
scanf("%d",¬eTwo); | |
students[i]->noteTwo=noteTwo; | |
printf("\n Ogrencinin ucuncu notunu girin: "); | |
scanf("%d",¬eThree); | |
students[i]->noteThree=noteThree; | |
printf("\n Ogrencinin dorduncu notunu girin: "); | |
scanf("%d",¬eFour); | |
students[i]->noteFour=noteFour; | |
printf("\n Ogrencinin besinci notunu girin: "); | |
scanf("%d",¬eFive); | |
students[i]->noteFive=noteFive; | |
} | |
viewAllStudents(students); | |
free(students); | |
return 0; | |
} | |
void viewAllStudents(struct Student **students) { | |
int i; | |
for(i=0;i<50;i++) { | |
printf("i is :%d\n",i); | |
printf("Name is : %s\n", students[i]->name); | |
printf("His note one is : %d\n",students[i]->noteOne); | |
printf("His note two is : %d\n",students[i]->noteTwo); | |
printf("His note three is : %d\n",students[i]->noteThree); | |
printf("His note four is : %d\n",students[i]->noteFour); | |
printf("His note five is : %d\n",students[i]->noteFive); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment