Examveda

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

A. hello

B. Run time error

C. Nothing

D. Depends on compiler

Answer: Option A


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union