Example #1
0
func main() {
	cs := C.CString("Hello from stdio\n")
	C.myprint(cs)
	C.free(unsafe.Pointer(cs))
}
Example #2
0
File: main.go Project: zchee/cgo
func main() {
	cp()
	cs := C.CString("Hello from stdio\n")
	C.myprint(cs)
	// fmt.Printf("main")
}
Example #3
0
func Foo() {
	var cs *C.char = C.CString("Hello, world!\n")
	C.myprint(cs)
	C.free(unsafe.Pointer(cs))
}
Example #4
0
func Print(s string) {
	cs := C.CString(s)
	defer C.free(unsafe.Pointer(cs))
	C.myprint(cs)
}