Hi all,
I can't find any problem in this program, i getting empty string as output, why?
what happening here any one help?
[code=c]
int main()
{
char *p1=“name”;
char *p2;
p2=(char*)mallo c(20);
memset (p2, 0, 20);
while(*p2++ = *p1++);
printf(“%s\n”,p 2);
return 0;
}[/code]
I can't find any problem in this program, i getting empty string as output, why?
what happening here any one help?
[code=c]
int main()
{
char *p1=“name”;
char *p2;
p2=(char*)mallo c(20);
memset (p2, 0, 20);
while(*p2++ = *p1++);
printf(“%s\n”,p 2);
return 0;
}[/code]
Comment