You you specifically want an array as in char x[200]; to be filled, you can use the std::copy subroutine provided by the <algorithm> header. E.g.
Code:
#include <algorithm>
#include <string>
int main() {
std::string s("Hello!");
char x[200];
*(std::copy(s.begin(), s.end() - s.begin() < 200 ? s.end() : s.begin() + 199, x)) = 0;
}
This code makes sure that no more than 199 elements are copied, leaving room for the null terminator and assigning it. You should only use c_str() if you intend on only using the returned read-only char* before your next non-const member function on s -- so that makes it only good for short-term use, like functions or methods that expect char*s. You could use strncpy on the c_str, but that's no better than std::copy. In fact, it might be worse because at least one implementation of c_str() that I vaguely remember reading about copies the contents of the string into a separate buffer.