-
Notifications
You must be signed in to change notification settings - Fork 1
convert tips
sivchari edited this page May 1, 2021
·
3 revisions
The bool and numeric types are the same in Go, C, and Nim, so no conversion is needed.
If the string type is created on the Go side, it will be returned as *C.char, and if it is created on the Nim side, the Go side can return it as string type.
Convert *C.char in C package C.GoString
func charTostring(a *C.char) {
aa := C.GoString(a)
}
Proprietary types return pointers and restore them in the getter
Type = TypeName | TypeLit | "(" Type ")" .
TypeName = identifier | QualifiedIdent .
TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType |
SliceType | MapType | ChannelType .