I must be missing something pretty simple, but I have a C struct like this:
typedef struct line
{
char hostname[HOSTNAME_MAX];
char ip[IP_MAX];
...
}
When I try to do the simple thing
C.GoString(p.hostname)
I get an error like
cannot use p.hostname (type [25]_Ctype_char) as type *_Ctype_char in
argument to _Cfunc_GoString
I've seen some examples but they all rely on *C.char and I haven't found
any way to get a [25]_Ctype_char to a pointer representation.
What do I need to do to convert a char[] to []byte of string in Go?
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/3a27c19c-7d96-4a5c-afc2-61f42215b2e2%40googlegroups.com.