تحية طيبه وبعد
يا جماعة يا ليت تشوفون لي حل ماني داري وش الخطأ في الكود هذا
#include <stdio.h>
struct student{
char *name;
char *id;
float gpa;
};
int main (void){
// define variable
char *a,*b;
float x;
struct student st[5];
int i,index;
float max,min,avg;
FILE *inputFile;
// open file
inputFile= fopen ("student.txt","r");
i=0;
//read file and store in structure
while (i<5) {
fscanf(inputFile,"%s %s %f\n",&*a,&*b,&x);
st.name=a;
st.id=b;
st.gpa=x;
printf("\n%s %s %f",st.name,st.id,st.gpa);
i++;
}
الى هنا الكود شغال زي الحلاوة
// i=0;
// while (i<5){
// printf("\n%s %s %f",st.name,st.id,st.gpa);
// i++;
// }