Multiple choice

What will be the output of the following function?

#include<stdio.h> main() { struct xx { int x=3; char name[]=hello; }; struct xx *s; printf(%d,s->x); printf(%s,s->name); }

  1. 3 HELLO

  2. 3 hello

  3. Error

  4. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In C, you cannot initialize members inside a structure definition, nor can you declare an array without a size inside a structure unless it is a flexible array member. These syntax violations cause a compilation error.