I get "warning: assignment from incompatible pointer type" when compiling. How can I don't get that warning?
Here is some part of source code:
typedef struct
{
char id[9];
char fName[9];
char lName[9];
int finalExam;
int midTerm;
float quiz1;
float quiz2;
float quiz3;
float totalMark;
} Student;
....
....
....
pointAt = students; // initialize pointer
float* topMark;
char* topLname;
char* topId;
topMark = &(*pointAt).totalMark;
topLname = &(*pointAt).lName;
topId = &(*pointAt).id;
printf("top guy : %s\n", topLname);
pointAt += 1;
I get that warning at:
topLname = &(*pointAt).lName;
topId = &(*pointAt).id;
these 2 lines causes that warning, because it points to char array. How can I fix this?