Functions that get called automatically

S

Saurabh

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-:)
 
G

Gernot Frisch

Saurabh said:
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")
 
S

Saurabh

Gernot said:
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:)
 
G

Gernot Frisch

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
 
P

peter koch

Saurabh said:
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
 
R

robertwessel2

Saurabh said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top