struct A { int x; int y; } struct B { int x; float z; } A a = { x: 10, y: 20 }; B b = { x: 1, z: 1.0f }; assign(a, b); assert(a.x == 1);
See Implementation