The program suppose to read a bunch of files in the dir and parse them. After parse the data it will outputs to another file
However, when I finish doing everything (everything is working) I got this seg fault and created a core dump.
Does anyone know why? I have been googling around and most of the time people use FILE *file. I didn't use that so I don't think there's anything wrong with the pointers. I tried free and delete but it doesn't really do anything
Here is my code..I just ignore the output file part and replaced with cout << "yay" since it doesn't matter
for (int i = 0; i < numFiles; i++) {
ifstream inFile;
inFile.open (fileName);
if (inFile.fail()) {
break;
} else {
cout << "yay" << endl;
}
inFile.close();
}
Thanks for the help!

New Topic/Question
Reply




MultiQuote




|