D
Dan
I have a very simple validation function, lets say for negative number:
The function is called during a series of questions,
Besides doing exit like I did, is there an easy way so that the program ask
the question again or go back to the previous, accounting that there are
menus
D
int Validate_positive(float &c)
{
if (c < 0)
{ cout<< "You have type a negative integer, Please try again with a
positive number! " <<endl;
exit(1); } //exits the program and starts over with a positive number
return 0;
}
The function is called during a series of questions,
Besides doing exit like I did, is there an easy way so that the program ask
the question again or go back to the previous, accounting that there are
menus
D
int Validate_positive(float &c)
{
if (c < 0)
{ cout<< "You have type a negative integer, Please try again with a
positive number! " <<endl;
exit(1); } //exits the program and starts over with a positive number
return 0;
}