c2.go 210 B

12345678910111213
  1. // c2.go
  2. package print
  3. // #include <stdio.h>
  4. // #include <stdlib.h>
  5. import "C"
  6. import "unsafe"
  7. func Print(s string) {
  8. cs := C.CString(s)
  9. defer C.free(unsafe.Pointer(cs))
  10. C.fputs(cs, (*C.FILE)(C.stdout))
  11. }