I get this error whenever i run the program " Assignment makes pointer from Integer without a cast". My code is written below.... Please help... Thankx
struct student {
char studentID[6];
char name[31];
char course [6];
};
struct student *array[MAX];
struct student dummy;
int recordCtr=0;
int read(){
FILE *stream = NULL;
int ctr;
char linebuffer[45];
char delims[]=", ";
char *number[3];
char *token = NULL;
stream = fopen("student.txt", "rt");
if (stream == NULL) stream = fopen("student.txt", "wt");
else {
printf("\nReading the student list directory. Wait a moment please...");
while(!feof(stream)){
array[recordCtr]=(struct student*)malloc(sizeof(struct student));
while(!feof(stream)) {
fgets(linebuffer, 46, stream);
token = strtok(linebuffer, delims); //This is where the error appears
ctr=0;
while(token != NULL){
strcpy(number[ctr], linebuffer);
token = strtok(NULL, delims); //This is where the error appears
ctr++;
}
strcpy(array[recordCtr] -> studentID,number[0]);
strcpy(array[recordCtr] -> name,number[1]);
strcpy(array[recordCtr] -> course,number[2]);
}
recordCtr++;
}
recordCtr--;
fclose(stream);
}