Question
#include<stdio.h>
int main()
{
union a
{
int i;
char ch[2];
};
union a u1 = {512};
union a u2 = {0, 2};
return 0;
}
Which of the following statements correct about the below program?
#include<stdio.h>
int main()
{
union a
{
int i;
char ch[2];
};
union a u1 = {512};
union a u2 = {0, 2};
return 0;
}
- u2 CANNOT be initialized as shown.
- u1 can be initialized as shown.
- To initialize char ch[] of u2 '.' operator should be used.
- The code causes an error 'Declaration syntax error'
Answer: Option C
Was this answer helpful ?
No answer description available for this question.
Was this answer helpful ?
More Questions on This Topic :
Question 2.
A union cannot be nested in a structure
....
Submit Solution