+ 1
Can we use typedef for union also?
2 Réponses
+ 5
Yes.
typedef union{ int a; float b; } myUnion;
myUnion u;
+ 1
yes
here is the example
#include<stdio.h> typedef union myunion { double PI; int B; }MYUNION; int main() { MYUNION numbers; numbers.PI = 3.14; numbers.B = 50; return 0; }