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
How many bytes is a struct in c?
List some of the dynamic data structures in C?
Explain the difference between strcpy() and memcpy() function?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
How many levels of indirection in pointers can you have in a single declaration?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What is actual argument?
How can I read in an object file and jump to locations in it?
How does placing some code lines between the comment symbol help in debugging the code?
What are the types of data files?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What is zero based addressing?
Is c still used?
Is it possible to pass an entire structure to functions?
What is the difference between near, far and huge pointers?