import "C"
func f() {
var vGo int
var vC C.int
// fails to compile with error
// cannot use &vGo (type *int) as type *C.int in argument to...
C.c_function(&vGo)
// compiles just fine:
C.c_function(&vC)
}
我用 CGO_ENABLED=1 GOARCH=arm 编译...
在这种情况下 int 和 C.int 类型有什么不同?
在哪里可以找到有关 GO 中 C 类型的其他信息?
RISEBY
天涯尽头无女友
相关分类