[go-nuts] Re: Converting a C char[] to []byte of string with cgo

2020-04-30 Thread peterGo
Dean, Command cgo https://golang.org/cmd/cgo/#hdr-Go_references_to_C In C, a function argument written as a fixed size array actually requires a pointer to the first element of the array. C compilers are aware of this calling convention and adjust the call accordingly, but Go cannot. In Go, yo

[go-nuts] Re: Converting a C char[] to []byte of string with cgo

2020-04-30 Thread mike
C.GoString((*C.char)(&p.hostname)) -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web

[go-nuts] Re: Converting a C char[] to []byte of string with cgo

2020-04-30 Thread Dean Schulze
I've also tried this var src [24]C.char = p.mach_ip and this var src *[24]C.char = &p.mach_ip and both give panics. > > -- 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