4/10/08

main(), wmain() and _tmain()…What is the deifference?

In the name of Allah the most merciful the most gacious

In the beginning of this topic, I’d like first to give a brief definition of main().

main() is the head function in the C++ program, that means that this function is the function

which the program begins executing it before any other functions.

wmain() may be considered as a different version of the main() function, as the wmain() is also

the first function to be executed, but the difference is that the wmain() is used for the programs

which needs to support unicode, this functions helps you dealing with unicode characters in your

program and in the program’s command lines.

As for _tmain(), _tmain() is a function that can resolve to main() unless there is a unicode, it resolves to wmain()…

Hope this topic would be useful…

                    BEST REGARDS,

                             THE DEVELOPER - Khaled Hamdy

0 comments: