from const char to char

This is a discussion on from const char to char within the C++ Programming forums, part of the General Programming Boards category; Hi All
I'm writing a tool that uses C libraries.
Which means that I have to convert string s into ...

If the size of the string is variable, you will probably need a variable length character array. In that case, use a vector so that it will handle memory management for you. Then pass the vector to the code that expects a char*: