diff --git a/ch2-cgo/ch2-07-memory.md b/ch2-cgo/ch2-07-memory.md index c259e47..1f74598 100644 --- a/ch2-cgo/ch2-07-memory.md +++ b/ch2-cgo/ch2-07-memory.md @@ -54,11 +54,15 @@ cgo之所以存在的一大因素是为了方便在Go语言中接纳吸收过去 package main /* +#include +#include + void printString(const char* s) { printf("%s", s); } */ import "C" +import "unsafe" func printString(s string) { cs := C.CString(s)