main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?
Answer Posted / sanath
ANS: NULL
It is a bit tricky question. If u observe carefully then we
are incrementing the pointers p1,p2. When it reached the end
of the string, *p2 points to NULL. We have lost the address
of the starting position.
| Is This Answer Correct ? | 40 Yes | 5 No |
Post New Answer View All Answers
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
Can we change the value of static variable in c?
Explain how can I read and write comma-delimited text?
How would you rename a function in C?
Why is c so powerful?
Can you mix old-style and new-style function syntax?
Explain modulus operator.
What is the right type to use for boolean values in c?
Tell me the use of bit field in c language?
When would you use a pointer to a function?
Describe the header file and its usage in c programming?
Define macros.
Does c have enums?
will u please send me the placement papers to my mail???????????????????
Why should I prototype a function?