I use the tinyXML library, which parses XML files. Many of its methods return const char *.
After reading this question: how to return a char array from a function in C
Now I suppose that every time the method returns char *, it is responsible for the call (mine) to explicitly release it, because it is probably dynamically allocated on the heap. Right wrong? What can I guess?
(If I ever wrote a library, I would rather return std :: string instead of char * arrays, because they are much easier for the user.)
c ++ c arrays pointers memory
SPQR3
source share