Examveda

What will be the output of the following C code?
#include <stdio.h>
struct student
{
    char *c;
    struct student *point;
};
void main()
{
    struct student s;
    struct student m;
    s.c = m.c = "hi";
    m.point = &s;
    (m.point)->c = "hey";
    printf("%s\t%s\t", s.c, m.c);
}

A. hey hi

B. hi hey

C. Run time error

D. hey hey

Answer: Option A


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union