1
I have a .lib
with some functions. I defined that when the calculation of some function generates values outside the range allowed it to exit()
.
Now my C++ code that uses this lib need to calculate some of these functions but if the function I calculate in the middle of the path generate a Exit it aborts and does not calculate the others. Is there any way to check whether it returns in a Exit or not, and if you return skip the function?
I’m not sure if there would be another flag better for values outside the allowed range than the Exit. I would try a return Null;
but some of these functions generate vector<double>
So what would be the best way to do that?
The function
exit
returnsEXIT_SUCCESS
( Zero ) if the execution has been successful orEXIT_FAILURE
if the execution has failed, both returns are macros. You can treat the range of invalid values with a simple if / switch ( Switch with techniques to cover ranges of values in each case ). It is worth indicating the use ofabort
in place ofexit
for your program to continue running normally.– user48471
Trying to solve this problem reminded me that answer about the parade problem
– Jefferson Quesado