Write a C + + program that asks the user a value for the width; and then displays the corresponding square area. If the width is not an integer, the situation will be treated as an exception. Exception handling subroutine will restore the width to 0 and will warn the user of the mistake made.
if anybody can help me tyo solve this with or without classes.
thank you
You throw and catch them by their type. Because each exception needs to have a different type, the C++ library offers an std::exception class that you can derive your own exceptions from, to make your job easier.