Quote:Original post by Battousai
Now this one is working:
*** Source Snippet Removed ***
But, why doesn't the WinMain() alternative fails? Though, it worked with other IDEs like CodeBlocks and Dev-C++.
The short answer is that neither WinMain nor main is the *true* entry point for your application. It's actually a function even much deeper than that. Visual C++ is just "helping you" by choosing a signature that it think is probably related to the type of application you're developing. The true entry point is deep in the C runtime library, and is called automatically. This function ultimately ends up calling your entry point after some setup work.
A console app can in theory be ported to other platforms. Because of this, they demand you use the C++ standard defined entry point, which is
int main(int, char**)
windows apps are already highly platform specific, so they give you extra information in the main function that wouldn't even be relevant to you in a console app anyway.
Longer answer depends on some internal details of MSVCRT (Microsoft's implementation of the C runtime library), and is probably not that important anyway.
If you choose a console app, use the tmain entry point. If you choose a windows app, use the WinMain entry point.