LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   trap command for c? (https://www.linuxquestions.org/questions/programming-9/trap-command-for-c-229568/)

onnyloh 09-12-2004 12:50 AM

trap command for c?
 
does c has the "trap" function or similiar function.

i.e run whenever the the program is ended or being killed.

Something like c++ destructor.

itsme86 09-12-2004 01:38 AM

It's called atexit().

jlliagre 09-12-2004 06:01 AM

See also "signal" or better "sigaction" for more general signal handling.

onnyloh 09-13-2004 04:06 AM

setting signal handle is a tedious action...
i prefer atexit.
thank. :)


All times are GMT -5. The time now is 05:19 AM.