Structure assignment copies values of all members
➜ shallow copy only
struct point {
int x;
int y;
};
struct point a = {1, 2};
struct point b = a;
printf("x = %d, y = %d", b.x, b.y);
// Output: x = 1, y = 2
.
struct point {
int xy[2];
};
struct point a= {{1, 2}};
struct point b= a;
printf("xy[0] = %d, xy[1] = %d", b.xy[0], b.xy[1]);
// Output: xy[0] = 1, xy[1] = 2
status | not read | reprioritisations | ||
---|---|---|---|---|
last reprioritisation on | suggested re-reading day | |||
started reading on | finished reading on |