Pregunta

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

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top