c,cgo,go中类型转换关系 - Sat, Oct 24, 2020
c,cgo,go中类型转换关系
C语言类型 | CGO类型 | Go语言类型 | SDK |
---|---|---|---|
char | C.char | byte | |
singed char | C.schar | int8 | |
unsigned char | C.uchar | uint8 | BYTE |
short | C.short | int16 | |
unsigned short | C.ushort | uint16 | WORD,USHORT |
int | C.int | int32 | BOOL,LONG |
unsigned int | C.uint | uint32 | DWORD,UINT |
long | C.long | int32 | |
unsigned long | C.ulong | uint32 | |
long long int | C.longlong | int64 | |
unsigned long long int | C.ulonglong | uint64 | |
float | C.float | float32 | |
double | C.double | float64 | |
size_t | C.size_t | uint | |
void* | unsafe.Pointer | unsafe.Pointer | LPVOID,HANDLE |