string s;
charc=(char)s.c_str();
why do we type cast it?
What is c_str() doing?
I think you are missing something, because this function returns a constant Null terminated pointer to the character array storage of the string.
it has been used in above code to convert string of c++ into character array of c language
okay i got your doubt.
so the c_str() returns the variable of datatype => const char *
so if you will not typecast it, it will error.
got it ?
thanks a lot sir,now i got it!