From 4e2f1e8ab094864ccbdbeea2c6ababdb6ac9cee1 Mon Sep 17 00:00:00 2001 From: InkDP Date: Sun, 19 Dec 2021 21:48:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B92.7.2=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BF=90=E8=A1=8C=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch2-cgo/ch2-07-memory.md | 4 ++++ 1 file changed, 4 insertions(+) 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)