I have few very simple question. I searched a web for them, but I found different answers so I just want to know which to follow.
So, first, I believe WinMain is NOT C or C++ standart, but is only added by Microsoft to determine when to load different CRT startup code, am I right?
And second, is WinMain called by OS, in a way of lets say similiar to dynamic linking, or is it just program startup point like main?
Why I ask? I mainly used C for programming MCUs. I am more HW oriented than SW, so I like MCUs, I find them and programming for them more “clear”.
But when I started to get interested about C language itself and its standart, I found that its very hard. I mean, for example, on MCU, you need no int return type of main, as well as in win32 app you need different startup code than pure main has.
So, I like C but I find its standart to be somehow old. Thanks.
Yes. All C and C++ standards define
main()(and onlymain()) as the program entry point (although its exact signature may vary between languages and standard versions).It is actually called from
main(). There is amain()in Windows programs too, just hidden deep within WinAPI code.