MCQ Single Best Answer Not Set

QThe output of the code below is

    #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();
        s.name = "turing";
        printf("%s", m.name);
    }

ID: #2638 Structure in C Language 3,627 views
Question Info
#2638Q ID
Not SetDifficulty
Structure in C LanguageTopic

Choose the Best Option

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

  • A alan
  • B Turing
  • C Compile time error
  • D Nothing
Correct Answer: Option C

Explanation

Compile time error

Share This Question

Challenge a friend or share with your study group.