We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5752e6a commit b52b74eCopy full SHA for b52b74e
C/uninon.c
@@ -0,0 +1,27 @@
1
+//sizeof() an union example
2
+
3
+#include<stdio.h>
4
+void main()
5
+{
6
+ int a;
7
+ float b;
8
+ struct student_details
9
+ {
10
+ char name[20];
11
+ int regno;
12
+ }student;
13
14
+ union code
15
16
+ int x;
17
+ char c;
18
+ float y;
19
+ }sample;
20
21
+ printf("size of variable a=%d\n",sizeof(a));
22
+ printf("size of variable b=%d\n",sizeof(b));
23
+ printf("size of structure variable is %d\n",sizeof(student));
24
+ printf("size of union variable is %d\n",sizeof(sample));
25
+ printf("size of integer is %d\n",sizeof(int));
26
27
+}
0 commit comments