문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top