Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   what will be the output? (http://www.go4expert.com/forums/output-t5960/)

indian.21987 21Aug2007 13:03

what will be the output?
 
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?

shabbir 21Aug2007 14:54

Re: what will be the output?
 
Duplicate of what will the output?. Thread closed.


All times are GMT +5.5. The time now is 03:51.