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
Why clrscr is used after variable declaration?
What is page thrashing?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is the most efficient way to count the number of bits which are set in an integer?
What does 4d mean in c?
What is the difference between functions getch() and getche()?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What would be an example of a structure analogous to structure c?
Why isnt any of this standardized in c?
Explain how do you override a defined macro?
List some of the dynamic data structures in C?
If null and 0 are equivalent as null pointer constants, which should I use?
What is your stream meaning?