Examveda

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

A. alan alan

B. Compile time error

C. Varies

D. Nothing

Answer: Option B


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union