Examveda

What will be the output of the following C code?
#include <stdio.h>
struct student fun(void)
{
    struct student
    {
        char *name;
    };
    struct student s;
    s.name = "alan";
    return s;
}
void main()
{
    struct student m = fun();
    printf("%s", m.name);
}

A. Compile time error

B. alan

C. Nothing

D. Varies

Answer: Option A


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union