CString str("Hello World!"); const char* cstr = str.c_str();In this example, a CString object "str" is created with the value "Hello World!". The c_str() function is used to get a pointer to the C-style string equivalent of "str" and it is stored in a variable "cstr". This function is particularly useful when we need to pass a CString object to a function that expects a C-style string as a parameter. Package library: MFC (Microsoft Foundation Class) library.