Question

I need to create a string on the heap, I was wondering if there is something similar already included in the standard libraries, or do I have to implement it myself (using malloc())?

Was it helpful?

Solution

You could use malloc(), calloc() or strdup() (the latter is POSIX, not standard C).

It is not totally clear what you mean by "implement it myself (using malloc())" -- what exactly is there to implement?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top