I have a string to convert, string = "apple" and want to put that into a C string of this style, char *c, that holds {a, p, p, l, e, '\0'}. Which predefined method should I be using?
I have a string to convert, string = apple and want to put that
Share
.c_str()returns aconst char*. If you need a mutable version, you will need to produce a copy yourself.