#include #include #include struct ogrenci { char isim[20]; int not[2]; }; struct ogrenci ogrenciOlustur() { struct ogrenci kayit; printf("ogrenci adini giriniz"); scanf("%s",kayit.isim); printf("\n"); printf("ogrencinin fizik notunu giriniz:"); scanf("%d",&kayit.not[0]); printf("\n"); printf("ogrencinin programlama notunu giriniz:"); scanf("%d",&kayit.not[1]); printf("\n"); return kayit; } const void* printOgrenci(struct ogrenci x) { printf("%s",x.isim); printf("%d",x.not); } int main() { FILE *f1; f1=fopen("deneme.txt", "w"); struct ogrenci ogrenci1; struct ogrenci ogrenci2; ogrenci1=ogrenciOlustur(); printf("\n"); ogrenci2=ogrenciOlustur(); fprintf(f1,"Ilk ogrenci bilgileri:\n"); fwrite(printOgrenci(ogrenci1),sizeof(printOgrenci(ogrenci1)),1,f1); fprintf(f1,"Ikinci ogrenci bilgileri:\n"); fwrite(printOgrenci(ogrenci2),sizeof(printOgrenci(ogrenci2)),1,f1); fclose(f1); return 0; }