Struct Foo{ char *pName; char *pAddress;};main(){ struct Foo *obj = malloc(sizeof(struct Foo));clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress);}

A) Your Name Your Name
B) Your Address, Your Address
C) Your Name, Your Address
D) None of the above
Explanation: Prints Nothing, as after free(obj), no memory is there containing obj->pName & pbj->pAddress

Showing Answers 1 - 4 of 4 Answers

shweta

  • May 16th, 2006
 

hi,

this gives runtime error...

i tried it.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions