Is it possible to use exceptions with file opening as an alternative to using .is_open()
?
For example:
ifstream input;
try{
input.open("somefile.txt");
}catch(someException){
//Catch exception here
}
If so, what type is someException
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…