icp/oer/courses/c-basics/sections/24-dynamic-memory/04-concat-strings/content.html

9 lines
356 B
HTML

<p>
Another example were you could allocate memory on the heap is the concatenation of two strings.
This has the advantage that you don't have to pass memory with the right size into the function.
The downside is, that you have to remember to free the memory when you don't need it anymore.
</p>
<p>
Implement the concat function with malloc.
</p>