mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 23:08:34 +08:00
14 lines
210 B
Go
14 lines
210 B
Go
// c2.go
|
|
package print
|
|
|
|
// #include <stdio.h>
|
|
// #include <stdlib.h>
|
|
import "C"
|
|
import "unsafe"
|
|
|
|
func Print(s string) {
|
|
cs := C.CString(s)
|
|
defer C.free(unsafe.Pointer(cs))
|
|
C.fputs(cs, (*C.FILE)(C.stdout))
|
|
}
|