Tuesday, July 14, 2009

How can one suppress/change order static routine call in C++/C ?

This is for C/c++ programmer. I'd like to know how can we suppress/change order of static routine which are executing from code automatically at startup. You don't need to bother about whats routine are for here, just imagin they are called whenever ur application started.

How can one suppress/change order static routine call in C++/C ?
When you have an OO language, my suggestion will always be to use those OO features.


That said, for C++ I would model objects and use their constructors to get a good start in which I can determine the order of construction by calling as needed. Please see the fist link below on how to manage static construction.


So don't think about "functions" but "state/objects" and their "initialization".


No comments:

Post a Comment