C++ Programming Code Examples C++ > Strings Code Examples Convert string into constant character array Convert string into constant character array Sometimes it's useful to convert a string object to the constant char array. You can do this by using c_str() function as shown below const char* cstr = s3.c_str(); cout << "C++ Programming Language | Happy Codings :)";