Of course, we should describe in the documentation what happens to the old memory. If we say we’re going to free it, it better have been malloc’d beforehand.
]]>Either way would be fine. Given that the call to strappend will have foo point to something on the heap, it’s more consistent to make to make that string initially on the heap as well.
]]>In strappend, why do we use strdup for foo? why not char *foo = “jsdhaisudh”; instead?
]]>