can anyone tell me why the following gives me a bus error? Cheers
void doList(char args[]){
FILE *file;
char c;
List *list = NULL;
file = fopen(args, "r");
while(1){
c = fgetc(file);
if(c != EOF){
list = insertList(c, list);
}
else{
break;
}
}
fclose(file);
}
void doList(char args[]){
FILE *file;
char c;
List *list = NULL;
file = fopen(args, "r");
while(1){
c = fgetc(file);
if(c != EOF){
list = insertList(c, list);
}
else{
break;
}
}
fclose(file);
}
Comment