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

Differentiate between the expression “++a” and “a++”?

1199


Is c procedural or functional?

977


Can we change the value of constant variable in c?

1001


What is calloc()?

1023


How to declare pointer variables?

1160


How can I convert a number to a string?

1091


i want to know the procedure of qualcomm for getting a job through offcampus

2409


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1954


Give the rules for variable declaration?

1112


Explain what is the difference between a free-standing and a hosted environment?

1125


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1199


What is the difference between a function and a method in c?

1027


Can you please compare array with pointer?

1024


Explain pointers in c programming?

1060


What is pragma c?

1057