Re:F() vs. F(void) in C vs. C++
by innocenat on Monday May 13, 2019 @04:13AM
(#19897129)
Not on stdcall i.e. Win32 API.
[ Parent
| on HN ]
I've never done Windows programming but AFAICT you don't use `int main()` on Win32 anyway, you write something like
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR, int)
(where WINAPI is just a macro for __stdcall)I also found a reference saying you can in fact use `int main()` if you want to, in a GUI subsystem Windows app, by using the Microsoft linker options /subsystem:windows /ENTRY:mainCRTStartup, but in that case you're not writing a stdcall function anymore.
EDIT: I guess I should clarify, my previous comment was talking about cdecl functions, i.e. the default calling convention in C.