Throw exception

Per my assignment, I have to use SeProperForm(void) that should throw an exception if the denominator is zero. Here's my code for that which works but it closes out the program to quickly. I would like it to NOT close out the program until I hit the enter key.

void CRational::setProperForm()
{
// make sure there is no zero in the denominator--use assert or throw
//an exception
if(m_denominator == 0)
{
m_numerator = m_numerator;
m_denominator = m_denominator;
throw exception("denominator is zero.... exitting");
}

For example:
12/0
denominator is zero... exitting

Instead it quickly flashes and program closes out.
Topic archived. No new replies allowed.