can someone explain this syntax (char*)str.c_str() ?
Helper function
@priyeshant1104 hey , first of all c_str() converts a C++ string into a C-style string which is essentially a null terminated array of bytes. You use it when you want to pass a C++ string into a function that expects a C-style string (e.g. a lot of the Win32 API, POSIX style functions, etc).
Here in syntax str is converted into c type string using c_str and than it is typecasted to char using char * .hope you get it 
1 Like