Loading....
Coupon Accepted Successfully!

 

Question 11

Write a C program to implement your own strdup() function.


Here is a C program to implement the strdup() function.


char *mystrdup(char *s)
{
    char *result = (char*)malloc(strlen(s) + 1);
    if (result == (char*)0){return (char*)0;}
    strcpy(result, s);
    return result;
}







Test Your Skills Now!
Take a Quiz now
Reviewer Name