Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'stray \223 and \224 error' and other errors in C

Tags:

c

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);
}
like image 1000
Amin Husni Avatar asked Nov 27 '22 03:11

Amin Husni


1 Answers

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.

like image 176
dandan78 Avatar answered Jan 21 '23 13:01

dandan78