I've gotten some stray errors with some other errors, and I have no idea why:
[Error] stray '\223' in program
[Error] stray '\224' in program In function 'int readData(GymRecord**)':
[Error] 'q2' was not declared in this scope
[Error] request for member 'name' in '(dir + ((long long unsigned int)(((long long unsigned int)k) * 8ull)))', which is of non-class type 'GymRecord'
[Error] request for member 'age' in '(dir + ((long long unsigned int)(((long long unsigned int)k) * 8ull)))', which is of non-class type 'GymRecord'
int readData(struct GymRecord *dir[]){
FILE *fdir = fopen(“q2.txt”, "r");
char buff[MBUFF];
int k = 0;
while(k<MDIR && fgets(buff, MBUFF-1, fdir)){
strcpy(dir[k].name,strtok(buff, ","));
dir[k].age = atol(strtok(NULL, "\n"));
k++;
}
return(k);
}
You must have pasted some nicely-formated text from a website, but the compiler wants plain text. The problem is with your “
and ”
characters. Replace them with ordinary quotes, "
, and you should be fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With