示例#1
0
文件: basic.go 项目: freewu/learn
func main() {
	cs := C.CString("Hello from stdio\n")
	C.myprint(cs)
	C.free(unsafe.Pointer(cs))
}
示例#2
0
文件: main.go 项目: zchee/cgo
func main() {
	cp()
	cs := C.CString("Hello from stdio\n")
	C.myprint(cs)
	// fmt.Printf("main")
}
示例#3
0
文件: testcgo.go 项目: wb253/go-gb
func Foo() {
	var cs *C.char = C.CString("Hello, world!\n")
	C.myprint(cs)
	C.free(unsafe.Pointer(cs))
}
示例#4
0
文件: print.go 项目: NONFish/goc2p
func Print(s string) {
	cs := C.CString(s)
	defer C.free(unsafe.Pointer(cs))
	C.myprint(cs)
}