Closed
Description
by dturnbull:
go version go1.2.1 darwin/amd64 Apple LLVM version 5.0 (clang-500.2.79) Using this program: package main /* #include "stdlib.h" #include "stdint.h" #include "complex.h" typedef struct { uint32_t unalign; float complex osc; } mixer; mixer* Mixer() { mixer *o = malloc(sizeof(mixer)); o->osc = (3.0 + 5.0*I); return o; } */ import "C" import "fmt" func main() { o := C.Mixer() fmt.Println(o) } I get incorrect output: &{0 (5+0i)} Removing the unalign element or changing to a double complex gives the expected output: &{(3+5i)}