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

In C programming, what command or code can be used to determine if a number of odd or even?

627


Difference between pass by reference and pass by value?

660


Explain bitwise shift operators?

634


What is the use of bitwise operator?

694


What is a structure member in c?

552






how can I convert a string to a number?

600


Difference between macros and inline functions? Can a function be forced as inline?

716


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2376


Why do we use return in c?

571


Differentiate between functions getch() and getche().

627


Write a program to reverse a linked list in c.

649


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

637


write a program to copy the string using switch case?

2404


Is c is a high level language?

626


Where does the name "C" come from, anyway?

647