main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
Answer Posted / vignesh1988i
actually in this problem, the p2 will take characters after '\0' too from p1 upto the size of p2 come to an end.
so it prints
output :
Name #^$&dhd
thank u
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Is c a great language, or what?
formula to convert 2500mmh2o into m3/hr
what is use of malloc and calloc?
What is the translation phases used in c language?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
Why can't I perform arithmetic on a void* pointer?
What is character set?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
Explain how do you print an address?
Is stack a keyword in c?
Is null a keyword in c?
What is bubble sort in c?
What does a pointer variable always consist of?
What's the best way of making my program efficient?
What does the file stdio.h contain?