Question

is there any way to hide the WinMain() function inside a class? Thank you.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top