On Tue, 18 Apr 2017 02:25:07 -0700 (PDT)
hui zhang <[email protected]> wrote:
> c code
> string getstring() {...}
>
> go
>
> string gostr = ????(C.getstring())
Oh, and note that std::string is a fat object.
So if getstring() really returns an instance of std::string,
and you need to actually extract its "raw bytes", you'd need to call
the c_str() method of std::string on that object before applying the
techniques from [1] to it.
1. https://github.com/golang/go/wiki/cgo#go-strings-and-c-strings
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.