In Java actions can be set to perform on exit. Is there any way to do that
in C or C++? Is there any way to catch a kill signal and if one is sent,
do some closing down routines before dying?
I need to be able to shut down the connection to hardware when the program
ends and most of the time that isn't an issue (since I have an exit
command), but it would help if there were a way to do that if the program
were killed accidently as well. (And I'm sure there's no way to do that
in
case of a crash or core dump!)
Thanks!
Hal