This function should take in a char*, which may be null or may or may not otherwise be populated with data, allocate a new char* dst of appropriate length, correctly copy the string, and return the number of bytes copied.
Something is wrong with the function definition you are given above. What is it? Provide a corrected function definition.
1
Expert's answer
2016-02-19T07:58:17-0500
Answer: mallocPlusStrcpy(const char* src)
because memory must be both allocated and free in main or in mallocPlusStrcpy
Comments
Leave a comment