Functions that get called automatically

Discussion in 'C++' started by Saurabh, Aug 1, 2006.

  1. Saurabh

    Saurabh Guest

    Hi All,

    I want to know something.
    Apart from Constructor and Destructor are there any other functions
    which get called automatically without user calling them?
    If yes,please tell me which are the functions,or tell me some resource
    to know details regarding
    this thing.

    Thanking You

    Saurabh-:)
    Saurabh, Aug 1, 2006
    #1
    1. Advertising

  2. "Saurabh" <> schrieb im Newsbeitrag
    news:...
    > Hi All,
    >
    > I want to know something.
    > Apart from Constructor and Destructor are there any other functions
    > which get called automatically without user calling them?
    > If yes,please tell me which are the functions,or tell me some
    > resource
    > to know details regarding
    > this thing.


    the program entry point (usually called "main")
    Gernot Frisch, Aug 1, 2006
    #2
    1. Advertising

  3. Saurabh

    Saurabh Guest

    Gernot Frisch wrote:
    > "Saurabh" <> schrieb im Newsbeitrag
    > news:...
    > > Hi All,
    > >
    > > I want to know something.
    > > Apart from Constructor and Destructor are there any other functions
    > > which get called automatically without user calling them?
    > > If yes,please tell me which are the functions,or tell me some
    > > resource
    > > to know details regarding
    > > this thing.

    >
    > the program entry point (usually called "main")


    main is the entry point.I am talking about something like.....
    well like constructors and destructors are automatically called
    for object initialization and clean up.
    Like that only.
    One of my friend was asked in an interview that there are such 4 kinds
    of functions
    including 1.constructor 2. destructors.
    I want to know about other 2.
    anyways...
    thanks for your response.

    Saurabh:)
    Saurabh, Aug 1, 2006
    #3

  4. > main is the entry point.I am talking about something like.....
    > well like constructors and destructors are automatically called
    > for object initialization and clean up.
    > Like that only.
    > One of my friend was asked in an interview that there are such 4
    > kinds
    > of functions
    > including 1.constructor 2. destructors.
    > I want to know about other 2.
    > anyways...
    > thanks for your response.


    IIRC:

    C'tors, D'tors, CRT initialization, main
    Gernot Frisch, Aug 1, 2006
    #4
  5. Saurabh

    Raymond Guest

    Raymond, Aug 1, 2006
    #5
  6. Saurabh

    peter koch Guest

    Saurabh wrote:
    > Hi All,
    >
    > I want to know something.
    > Apart from Constructor and Destructor are there any other functions
    > which get called automatically without user calling them?
    > If yes,please tell me which are the functions,or tell me some resource
    > to know details regarding
    > this thing.
    >
    > Thanking You
    >
    > Saurabh-:)


    Nope. But the compiler might create functions automatically (copy
    constructor, assignment operator) if you do not declare them
    explicitly.

    /Peter
    peter koch, Aug 1, 2006
    #6
  7. Saurabh

    Guest

    Saurabh wrote:
    > main is the entry point.I am talking about something like.....
    > well like constructors and destructors are automatically called
    > for object initialization and clean up.
    > Like that only.
    > One of my friend was asked in an interview that there are such 4 kinds
    > of functions
    > including 1.constructor 2. destructors.
    > I want to know about other 2.
    > anyways...



    There are the atexit() functions.
    , Aug 2, 2006
    #7
    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. dx
    Replies:
    4
    Views:
    8,398
    Teemu Keiski
    Apr 10, 2004
  2. Xiangliang Meng
    Replies:
    1
    Views:
    1,591
    Victor Bazarov
    Jun 21, 2004
  3. Sriek
    Replies:
    21
    Views:
    934
    Simon Brunning
    May 27, 2005
  4. Daniel Völkerts

    to_s isn't automatically called

    Daniel Völkerts, Jul 29, 2004, in forum: Ruby
    Replies:
    3
    Views:
    96
    Daniel Völkerts
    Jul 29, 2004
  5. David Mathog
    Replies:
    9
    Views:
    576
    Ian Collins
    May 26, 2012
Loading...

Share This Page