My program is crahing, and honestly i am confused (c++)

Not likely to be your crash, but this code is terrible: if (fnameFile.is_open()) { while (fnameFile.eof() == false) { plFname.resize(numFnames); getline(fnameFile,line); numFnames += 1; } fnameFile.close(); } It doesn’t check for end of file correctly, because end of file happens during getline, not before. And the line variable goes nowhere. Try while (getline(fnameFile,line)) plFnames.push_back(line); fnameFile.close();

Make Exceptions work [closed]

There are some flaws in your code: you should prefer int.TryParse instead of Parse. An Exception should be an unexpected behavior, where you have to react in some way. A userinput is not unexpected, you know there’s a chance that the use inputs invalid data which you can/have to validate. When you use exceptions, you … Read more