error handle
C / C++ / MFC
3
Posts
2
Posters
0
Views
1
Watching
-
if a error occur in a function ,return false or handle it inside of function. for example: void fun() { bool isFail = openfile(...); if(isFail) { ::MessageBox(0,"open file fail",0,0); exit(0); } } bool fun() { bool isFail = openfile(...); if(isFail) { return false; } ........ return true; }
-
if a error occur in a function ,return false or handle it inside of function. for example: void fun() { bool isFail = openfile(...); if(isFail) { ::MessageBox(0,"open file fail",0,0); exit(0); } } bool fun() { bool isFail = openfile(...); if(isFail) { return false; } ........ return true; }