Code:
main()
{
char *p1=“name”;
char *p2;
p2=(char*)malloc(20);
memset (p2, 0, 20);
while(*p2++ = *p1++);
printf(“%s\n”,p2);
}
Also what is the use of malloc() function?
|
Light Poster
|
|
| 21Aug2007,13:03 | #1 |
|
Code:
main()
{
char *p1=“name”;
char *p2;
p2=(char*)malloc(20);
memset (p2, 0, 20);
while(*p2++ = *p1++);
printf(“%s\n”,p2);
}
Also what is the use of malloc() function? Last edited by shabbir; 21Aug2007 at 14:53.. Reason: Code block |
|
Go4Expert Founder
|
![]() |
| 21Aug2007,14:54 | #2 |
|
Duplicate of what will the output?. Thread closed.
|