Explain the work of both thing separately please

use of (char * ) and .c_str()
in (cahr *)str.c_str()

hello @guptanikhil898
c_str function converts c++ string to const char * string (i.e cstyle string).
but we want to work with char * type string so by using (char * ) str.c_str()

we are explicityly typecasting const char* into char *.