Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?



Answer Posted / ali fakoor

A part of uninitialized (and/or unowned) memory after (and
including) the sixth byte of the malloc-ed memory will be
printed out until reaching a NULL character in the memory
somewhere!

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many bytes is a struct in c?

1217


List some of the dynamic data structures in C?

1306


Explain the difference between strcpy() and memcpy() function?

1068


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1131


How many levels of indirection in pointers can you have in a single declaration?

1149


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

2149


What is actual argument?

1103


How can I read in an object file and jump to locations in it?

1073


How does placing some code lines between the comment symbol help in debugging the code?

1066


What are the types of data files?

1255


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1689


What is zero based addressing?

1239


Is c still used?

1100


Is it possible to pass an entire structure to functions?

1054


What is the difference between near, far and huge pointers?

1161