Single Choice Not Set

QWhat is the output of this C code?

    #include <stdio.h>
    struct student
    {
        char *name;
    };
    struct student fun(void)
    {
        struct student s;
        s.name = "alan";
        return s;
    }
    void main()
    {
        struct student m = fun();
        printf("%s", m.name);
    }

ID: #2665 Structure in C Language 1,206 views
Question Info
#2665Q ID
Not SetDifficulty
Structure in C LanguageTopic

Choose the Best Option

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

  • A Nothing
  • B alan
  • C Run time error
  • D Varies
Correct Answer

Explanation

alan

Share This Question

Challenge a friend or share with your study group.