Some of you probably know how to do this, but i just discovered how to encapsulate the main function. Using Dev C++ 4.9.9.0 i got this bit of code to compile and link with 1 warning issued: resolving _WinMain@16 by linking to _WinMain
It works perfectly, you are just using a WinMain "function" object that does not require 16 bytes of data to be passed to it.Code:#include <iostream>
class main
{
public:
main()
{
std::cout << "Hello !";
exit(0);
}
};
main WinMain;