I have the following code in C++ ( Visual Studio 2013 ) to declare a function prototype in a header file:
extern "C" __cdecl
short int
G_Init(
void *Ptr,
char Encoding);
and the compiler returns the following error:
error C2062: type 'short' unexpected
What I'm doing wrong ?
MSDN says : "Place the __cdecl
modifier before a variable or a function name ."
That is, extern "C" short int __cdecl G_Init
, not extern "C" __cdecl short int G_Init
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.