I need to create a custom exception called "IllegalSubscriptException" for a function called Rational that should let the function operator[] throw this exception if the denominator is neither 0 nor 1. Here is what I have so far:
The variables ss1 and ss2 is showing message "Incomplete type is not allowed".
Also, I'm getting the compile errors:
1 2 3 4 5
TestRationalClassWithExceptionHandling.cpp
1>c:\users\anderson.anderson-pc\google drive\advanced c++\rational\rational\testrationalclasswithexceptionhandling.cpp(5): error C2628: 'IllegalSubscriptException' followed by 'int' is illegal (did you forget a ';'?)
1>c:\users\anderson.anderson-pc\google drive\advanced c++\rational\rational\testrationalclasswithexceptionhandling.cpp(6): error C3874: return type of 'main' should be 'int' instead of 'IllegalSubscriptException'
1> Rational.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\sstream(10): error C2143: syntax error : missing ';' before 'namespace'