示例#1
0
func Print(s string) {
	cs := C.CString(s)
	defer C.free(unsafe.Pointer(cs))
	C.fputs(cs, (*C.FILE)(C.stdout))
}
示例#2
0
文件: file.go 项目: WXB506/golang
func (f *File) WriteString(s string) {
	p := C.CString(s)
	C.fputs(p, (*C.FILE)(f))
	C.free(unsafe.Pointer(p))
	f.Flush()
}
示例#3
0
文件: stdio.go 项目: gale320/cgo
func main() {
	f := new(C.FILE)
	p := C.CString("string content")
	C.fputs(p, (*C.FILE)(f))
}
示例#4
0
文件: c.go 项目: cloudson/Saturno
func main() {
	value := C.CString("Oi\n")
	C.fputs(value, (*C.FILE)(C.stdout))
}