Programming Language Union in C Language Question #2673
Single Choice Not Set

QWhat is the output of this C code?
    #include "stdio.h"
    struct
    {
        char *name;
        union
        {
            char *sval;
        } u;
    } symtab[10];
the first character of the string sval by either of

ID: #2673 Union in C Language 2,415 views
Question Info
#2673Q ID
Not SetDifficulty
Union in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A *symtab[i].u.sval
  • B symtab[i].u.sval[0].
  • C You cannot have union inside structure
  • D Both *symtab[i].u.sval & symtab[i].u.sval[0].
Correct Answer

Explanation

Both *symtab[i].u.sval & symtab[i].u.sval[0].

Share This Question

Challenge a friend or share with your study group.