There are different calling conventions available in C/C++ stdcall, extern, pascal etc. How many such calling conventions are available and what do each mean? Are there any links that describe these?
views:
606answers:
6Neither Standard C nor Standard C++ has such a concept - these are features of specific compilers, linkers and/or operating systems, so you should really indicate which specific technologies you are interested in.
and also Raymond Chen's series: First, Second, Third (this is mostly what you're asking), Fourth and Fifth
These concern what order to put parameters on the call stack, and when to use call by value and/or call by reference semantics. They are compiler specific extensions intended to simplify multilingual programming.
Standard C++ basically has two: extern "C"
and extern "C++"
. The latter is the default; this former used when you need to link to C code. Compilers may define other strings besides "C" and "C++". For instance, a compiler that's compatible with its Pascal sibling may define extern "Pascal".
Unfortunately, some compilers have invented keywords instead. In these cases, see the compiler documentation.