Doubt doubt doubt

( char* ) str.c_str( ); ----> bhaiya ye implement kese ho raha h samjhaoge ???

( char* ) str.c_str( ); ----> bhaiya ye implement kese ho raha h samjhaoge ???

hello @parth_tyagi

c str is a function that is used to convert c++ string class to const char* type pointer.

but since strtok function takes char * pointer, we need to type case const char * pointer to char * pointer.

that is the reason we are doing (char*) str.c_str()

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.