nFortunately, our program can gain control by replacing the call to terminate with a call to a
function that we
provide. We pass the address of our function to the library function set_unexpected. The following
shows the
syntax:
n
nvoid user_unexpected()
{ //user supplied function
n ...
n}
n
nint main() {
n set_unexpected(user_unexpected); //install
user function
n