I have a byte array of image in golang , i have to pass this array to my C function as char* . I did he following , data, err := ioutil.ReadAll(out.Body) str := fmt.Sprintf("%s",data) s:=C.main1(C.CString(str)) s:=C.main1((*C.char)(unsafe.Pointer(&data[0]))) but both the technique doesn't work. All i m receiving in my C function is some garbage value of length 4.
-- 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. For more options, visit https://groups.google.com/d/optout.