Ejemplo n.º 1
0
func Print(s string) {
	cs := C.CString(s)
	defer C.free(unsafe.Pointer(cs))
	C.fputs(cs, (*C.FILE)(C.stdout))
}
Ejemplo n.º 2
0
func (f *File) WriteString(s string) {
	p := C.CString(s)
	C.fputs(p, (*C.FILE)(f))
	C.free(unsafe.Pointer(p))
	f.Flush()
}
Ejemplo n.º 3
0
Archivo: stdio.go Proyecto: gale320/cgo
func main() {
	f := new(C.FILE)
	p := C.CString("string content")
	C.fputs(p, (*C.FILE)(f))
}
Ejemplo n.º 4
0
func main() {
	value := C.CString("Oi\n")
	C.fputs(value, (*C.FILE)(C.stdout))
}