main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?
Answer Posted / vadivel t
In addtion to the answer #5.
printf("%s\n",p2); will print the values from 6th byte to
20th byte.
6th byte to 20th bytes of the memory will contain some
Garbage value. So the output will be a string of garbage
values.
For desired o/p see the ans #5
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What is a program flowchart and explain how does it help in writing a program?
When should the volatile modifier be used?
how should functions be apportioned among source files?
What are the different data types in C?
What is this infamous null pointer, anyway?
Differentiate fundamental data types and derived data types in C.
what is a constant pointer in C
the question is that what you have been doing all these periods (one year gap)
What is a function in c?
Explain enumerated types.
What's a good way to check for "close enough" floating-point equality?
What is break in c?
Why clrscr is used after variable declaration?
What is c language in simple words?
Can you please explain the scope of static variables?