You use a throw expression to indicate that your program has encountered an exception.
throw expression syntax >>-throw--+-----------------------+---------------------------->< '-assignment_expression-'
The type of assignment_expression cannot be an incomplete type, or a pointer to an incomplete type other than one of the following:
The assignment_expression is treated the same way as a function argument in a call or the operand of a return statement.
If the assignment_expression is a class object, the copy constructor and destructor of that object must be accessible. For example, you cannot throw a class object that has its copy constructor declared as private.
The IBM® i has a restriction that the object thrown can be no larger than 16MB in size.
Related information