why its not letting me use "->" form
i cant understand this massage
'->grade' : left operand has 'struct' type, use '.'
in binary trees and stuff i used it all the time both on the left and the right sides
??
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct line {
char name[21], address[21], ID[10];
int grade;
int code;
};
struct line next_Id(FILE * room , int last_ID);
int main ()
{
FILE* c[2];
struct line temp;
c[0]=fopen("c:\\fl1.txt","r");//vote files ,each file represents the votes from a college
c[1]=fopen("c:\\fl2.txt","r");
temp=next_Id(c[0] , 666666666);
fclose(c[0]);
fclose(c[1]);
return 0;
}
/*
struct line {
char name[21], address[21], ID[10];
int grade;
int code;
};
*/
struct line next_Id(FILE * room , int last_ID)
{
struct line temp,max;
int flag;
flag=fscanf(room,"%10s%10s%10s%10d%10d%*c",&temp.name,&temp.address,&temp.ID,&temp.grade,&temp.code);
while (flag!=5)
{
flag=fscanf(room,"%10s%10s%10s%10d%10d%*c",&max.name,&max.address,&max.ID,&max.grade,&max.code);
if (max->grade)
}
return temp;
}