Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef STRDUP_H
- #include <stdlib.h>
- #include "strdup.h"
- #else
- char *strdup(const char *str){
- int len = strlen(str) + 1;
- char *buf = malloc(len);
- if(buf) memcpy(buf, str, len);
- return buf;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement