x);printf("%s", s->name); }"/>
Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. 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);

    }

  2. A.

     3 hello

    B.

     Compiler Error

    C.

     Linking error

    D.

     None of these

    View Answer

    Workspace

    Answer : Option B

    Explanation :

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


Be The First To Comment