Examveda

In the following C code, we can access the 1st character of the string sval by using . . . . . .
#include <stdio.h>
struct
{
    char *name;
    union
    {
        char *sval;
    } u;
} symtab[10];
. .

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].

Answer: Option D


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union