Possible Duplicate:
Is main() really start of a C++ program?
Is possible to call my function before program’s startup? How can i do this work in C++ or C?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can have a global variable or a
staticclass member.1)
staticclass member2) global variable
Note this link – Mirror of http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.14 / proposed alternative – posted by Lundin.