struct Foo
{
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}
a. “Your Name”
b. compile error
c. “Name”
d. Runtime error
Answer: A
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}
a. “Your Name”
b. compile error
c. “Name”
d. Runtime error
Answer: A
No comments:
Post a Comment