I have a C struct
struct Test {
int a;
}
typedef struct Test Test;
and in C I create a pointer,
Test* myTestPointer = new Test();
I obtain the struct pointer myTestPointer in Swift, and I have checked the pointer does indeed point to the correct address in both Swift and C.
But I'm having some difficulty understanding why the following two pieces of code are not equivalent as measured by the value of a back in the C code?
let x = myTestPointer
x!.pointee.a = 123 // correctly changes the memory, as reflected back in C code
var x = myTestPointer!.pointee
x.a = 123 // does not reflect change back in C code