#include #include /** * Create a copy of the provided string in a newly malloc'd * block of memory. The block is exactly the size needed for * the copy. THIS MUST BE FREED * @param scr -- the string to be copied * @return a pointer to the new copy * **/ char* strmcopy(char* src) { char* newstr = malloc((strlen(src)+1)*sizeof(char)); strcpy(newstr, src); return newstr; }