ExamVeda
Login
Home
This question belongs to C Program C Miscellaneous
C Miscellaneous
?

Determine Output:
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); 
}

Answer & Solution
Correct Answer: Option B

Initialization should not be done for structure members inside the structure declaration.

Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
RAVINA RAUNDALE
RAVINA RAUNDALE 8 years ago
I did not get