1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:40:04 -07:00

cmd/cgo: tweak doc to not show example of passing Go pointer

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/171360043
This commit is contained in:
Ian Lance Taylor 2014-11-10 08:12:43 -08:00
parent cea69d6877
commit 63fe9efb90

View File

@ -152,7 +152,7 @@ In C, a function argument written as a fixed size array
actually requires a pointer to the first element of the array.
C compilers are aware of this calling convention and adjust
the call accordingly, but Go cannot. In Go, you must pass
the pointer to the first element explicitly: C.f(&x[0]).
the pointer to the first element explicitly: C.f(&C.x[0]).
A few special functions convert between Go and C types
by making copies of the data. In pseudo-Go definitions: