Q. What will be the output of this code?
Code:void main()
{
struct xx
{
int x=3;
char name[] = "hello";
};
struct xx *s = malloc(sizeof(struct xx));
printf("%d", s->x);
printf("%s", s->name);
}
β
Correct Answer: (B)
Compiler Error
Explanation: Initialization should not be done for structure members inside the structure declaration.