C Programming - Structures, Unions, Enums - Discussion
Discussion Forum : Structures, Unions, Enums - Point Out Errors (Q.No. 8)
8.
Point out the error in the program?
#include<stdio.h>
int main()
{
union a
{
int i;
char ch[2];
};
union a z1 = {512};
union a z2 = {0, 2};
return 0;
}
Discussion:
21 comments Page 3 of 3.
Preethi said:
1 decade ago
I guess the variable ch is declared to be as character but int values are assigned to it. Am I correct?.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers