I'm facing the following problem when writing a CGO wrapper for Spread…
I have a C function which does the following (this is not the full source but I think you folks get the point):
#define MAX_GROUPS 32
#define MAX_GROUP_NAME 100
snprintf(groupnames, MAX_GROUPS_NAME, "%s", "test";
And then will be passed like this:
some_function((const char (*)) groupnames)
I try to get this working using Go.
The following snippet is at least not complaining about the types so I think this is the way to go.
var g _Ctype_char
But the problem is how do assign the actual values like:
g = "test"
I cannot use C.CString() this will create a *_Ctype_char and I've tried a lot of other things a have seen but no luck yet.
Any advice will be great !
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@example.com.
For more options, visit https://groups.google.com/groups/opt_out.