예제 #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)
}