Comment on How to design an API function that creates somethingparentComments−TillE12yIf that char* is just a pointer into a static array which maps error codes to strings, I'd generally prefer to use a separate API to do that.If it's a freshly allocated string that needs to be freed by the caller, well, that's one of many reasons I never enjoy my time with C.
Comments
If that char* is just a pointer into a static array which maps error codes to strings, I'd generally prefer to use a separate API to do that.
If it's a freshly allocated string that needs to be freed by the caller, well, that's one of many reasons I never enjoy my time with C.