Re: is atexit required?

Discussion in 'C Programming' started by Eric Sosman, Oct 8, 2013.

  1. Eric Sosman

    Eric Sosman Guest

    On 10/8/2013 2:20 PM, mhnbtngr wrote:
    > hi group,
    >
    > I am trying to understand atexit.
    > If I am not wrong,upon exit from our programm,OS automagically flushes
    > the buffers,cleansup not free'd memory.closes the files we had opened.
    > In that case why do we require atexit handlers?
    > Any helop or pointers appreciated.


    (Minor point: A "sensible" environment will recycle or dispose
    of the memory the program used, but this is not actually required
    by the C language.)

    Many programs need only the automatic cleanup the environment
    provides. But some programs may need additional cleanup, and the
    atexit() mechanism is one way to ensure it happens. You are not
    "required" to use it, but it's there in case you need it.

    --
    Eric Sosman
    d
    Eric Sosman, Oct 8, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Serve Laurijssen

    atexit and global destructors

    Serve Laurijssen, Jan 15, 2004, in forum: C++
    Replies:
    3
    Views:
    6,950
    tom_usenet
    Jan 15, 2004
  2. JKop
    Replies:
    8
    Views:
    448
  3. Bengt Richter
    Replies:
    0
    Views:
    280
    Bengt Richter
    Aug 25, 2004
  4. Chris Gorton

    atexit not being executed

    Chris Gorton, May 3, 2005, in forum: Python
    Replies:
    0
    Views:
    387
    Chris Gorton
    May 3, 2005
  5. James Kuyper

    Re: is atexit required?

    James Kuyper, Oct 8, 2013, in forum: C Programming
    Replies:
    1
    Views:
    159
    Seebs
    Oct 8, 2013
Loading...

Share This Page