Everytime I try to do this I get a segmentation error. It's been really bothering me because this was a pretty difficult assignment and its late because I can't fix this one thing. I get a segmentation fault when I try to run parseInputStream. I've tried changing the file pointer to a pointer to a file pointer but I still get the segmentation fault. The console prints all of the ns but none of the ws. Help please.
void parseInputStream(FILE *file, FILE *infile){
printf("w\n");
char string[9999999];
while(fscanf(infile, "%s", &string)!= EOF){
printf("w\n");
if(string[0] == ';'){
fgets(string, 9999999, infile);
continue;
}
parseInput(file, infile, string);
}
int main(int argc, char* argv[]){
printf("n\n");
FILE *file = fopen("intest.asm", "w");
printf("n\n");
FILE *infile = fopen("intest.j", "r");
printf("n\n");
parseInputStream(file, infile);
fclose(infile);
fclose(file);
return 0;
}