Hi, I tried in Linux m/c. looks like the gcc will not support the startup and exit pragma if we execute the gcc -Wall filename.c we will get the below mentioned warning
Warning : ignoring #pragma startup functionname Regards, Sandeep On Wed, Jun 30, 2010 at 1:30 AM, Varma <[email protected]> wrote: > Hi All, > Is there any way to call our function before main() is called ? > > I know there is a way in C++ as below , but Is there a standard way > in C ? > > #include <iostream.h> > class CStatic > { > public: > CStatic() { cout << "Before Main!" << endl; } > ~CStatic() { cout << "After Main!" << endl; } > }; > > CStatic cs; > int main() > { > cout << "Begin Main" << endl; > cout << "Doing something" << endl; > cout << "End Main" << endl; > } > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
