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
Differentiate between the expression “++a” and “a++”?
Is c procedural or functional?
Can we change the value of constant variable in c?
What is calloc()?
How to declare pointer variables?
How can I convert a number to a string?
i want to know the procedure of qualcomm for getting a job through offcampus
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Give the rules for variable declaration?
Explain what is the difference between a free-standing and a hosted environment?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
What is the difference between a function and a method in c?
Can you please compare array with pointer?
Explain pointers in c programming?
What is pragma c?