Converting a string to a character array (char)
Posted on 2003-11-10
suppose I have
string arg6; //my 6th argument for some function to be called soon
however i have to pass in this argument as a character array, char
char x = arg6.c_str();
but i get some const char* cannot be converted to char error...
is there a way to do what I want? I solved my problem by declaring arg6 as a char but i still want to know how to convert a string to char for my own sake. I do know how to conver it to a char*.