C Programming :: Structures, Unions, Enums - Discussion
Home > C Programming > Structures, Unions, Enums > MCQs Questions Discussion
3 / 43
What is the output of the following program ?
#include<stdio.h>
void main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s=malloc(sizeof(struct xx));
printf("%d",s->x);
printf("%s",s->name);
}
#include<stdio.h>
void main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s=malloc(sizeof(struct xx));
printf("%d",s->x);
printf("%s",s->name);
}
A3 hello
BGarbage value hello
C3 Garbage Value
DCompiler Error
ENone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!