What will be the output of the following C code?
#include <stdio.h>
struct student
{
char *name;
};
void main()
{
struct student s, m;
s.name = "st";
m = s;
printf("%s%s", s.name, m.name);
}
#include <stdio.h>
struct student
{
char *name;
};
void main()
{
struct student s, m;
s.name = "st";
m = s;
printf("%s%s", s.name, m.name);
}A. Compile time error
B. Nothing
C. Junk values
D. st st
Answer: Option D
Related Questions on Structure and Union
Which of the following can be a member of a structure?
A. Function
B. Another structure
C. Enumeration
D. All of the above

Join The Discussion