is there any way to hide the WinMain() function inside a class? Thank you.
is there any way to hide the WinMain() function inside a class? Thank you.
Share
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.
Nope, there isn’t. A better question is “why would you want to”? In Java or C#, the main function is a static class member, not because it is better or cleaner, but because the language does not allow non-member functions. In C++, they are allowed, and even encouraged in many cases.
It makes more sense for the main function, the entry point to your program, to be “outside”. It starts in a basically empty environment, and then it sets up anything that needs to be set up before calling into the actual application logic.