Simen Haugen wrote: > > I see. I stored the pointer in another array, so I thought it wouldn't > go out of scope. I guess this only works for object allocated on the > heap...? exactly, struct are stored like ints, on the stack and accessing them is invalid after the end of that scope.