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
What is s or c?
What are the Advantages of using macro
What is wrong with this initialization?
Can a function argument have default value?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
If you know then define #pragma?
What is #include cctype?
What is scope rule of function in c?
Explain what is the difference between the expression '++a' and 'a++'?
What is the best way of making my program efficient?
simple program of graphics and their output display
Why c language?
How can I convert a number to a string?
What is the correct code to have following output in c using nested for loop?
What does the c preprocessor do?