What will be the output of the following C code?
#include <stdio.h>
struct student
{
char *c;
};
void main()
{
struct student *s;
s->c = "hello";
printf("%s", s->c);
}
#include <stdio.h>
struct student
{
char *c;
};
void main()
{
struct student *s;
s->c = "hello";
printf("%s", s->c);
}A. hello
B. Segmentation fault
C. Run time error
D. Nothing
Answer: Option B

Join The Discussion