In article <4l************@individual.net>,
Ian Collins <ia******@hotmail.comwrote:
>subrat wrote:
>Hello,
I know that the main( ) function is the starting point of execution in a C++
program.
What if an object is in the global space before main()?
Where is the constructor of the class object called? Before main() or after
main()?
Before, it were called after main, it wouldn't be much use as the
application would have terminated!
Think OP meant before or after the execution of the first statement
of main. It need not be before. But there are requirements to that,
like it can be post-poned until the first use of somethinging the
translation unit in question, but even at that it is more involved
because there is different orderings possible as well there can
even be different levels of initialization possible.
--
Greg Comeau / 20 years of Comeauity! Intel Mac Port now in alpha!
Comeau C/C++ ONLINE ==
http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?