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?
.c_str()
returns a const char*
. If you need a mutable version, you will need to produce a copy yourself.