Struct Union Ex C
Struct Union Ex C
Struct Union Ex C
h>
union test {
int x, y;
};
int main()
// A union variable t
union test t;
return 0;
}
#include <stdio.h>
union test {
int x;
char y;
};
int main()
p1.x = 65;
// p2 is a pointer to union p1
return 0;
#include<stdio.h>
struct Point
int x, y;
};
int main()
p1.x = 20;
------------------------------------------------------------
#include<stdio.h>
struct Point
int x, y;
};
int main()
arr[0].x = 10;
arr[0].y = 20;
return 0;