Code:
#include <stdio.h>

void stringcopy(char *, char *);
int main()
{
    int i;
    char src[] = "hai this patil";
    char *dest = (char*)malloc(strlen(src)+1);

    stringcopy(dest , src);
    printf("source  = %s\n",src);
    printf("destination = %s\n",dest);

}
void stringcopy(char *t , char *s)
{
    while ((*t = *s) !=0) {
        s++;
        t++;
    }
}

Last edited by shabbir; 18Oct2011 at 11:54.. Reason: Code blocks