stdcall and cdecl

后端 未结 9 868
旧时难觅i
旧时难觅i 2020-11-27 09:17

There are (among others) two types of calling conventions - stdcall and cdecl. I have few questions on them:

  1. When a cdecl fun
9条回答
  •  情深已故
    2020-11-27 09:48

    It's specified in the function type. When you have a function pointer, it's assumed to be cdecl if not explicitly stdcall. This means that if you get a stdcall pointer and a cdecl pointer, you can't exchange them. The two function types can call each other without issues, it's just getting one type when you expect the other. As for speed, they both perform the same roles, just in a very slightly different place, it's really irrelevant.

提交回复
热议问题