Can CString :: Format () get const std :: string?
Example:
void some_func( const std::string a_string ) { CString b_string("World"); CString c_string; c_string.Format("%s %s!", a_string, b_string); /* print c_string */ };
No. You need to use the return value from a_string.c_str()(which is const char*which CString can understand).
a_string.c_str()
const char*
You can convert std::stringtoCString:
std::string
CString:
CString a_cstring( a_string.c_str() );
Then use a_cstring.
c_string.Format("%s %s!", a_cstring, b_string);
Source: https://habr.com/ru/post/1786756/More articles:Mac Flash Builder Cannot Find Debugger - debuggingIs it possible to split session state between asp classic and asp.net - asp.netUnderstanding processor seconds - pythonUsing an internal URL scheme with a UIWebView to change a UILabel - iosSpring LDA: problem with contextSource Bean - javaHow to split a dataset and graph in R - splitDoctrine: ODM vs. ORM - mongodbDownloading symbols for remote debugging - symbolsОбъект ввода с объектом "запрос" в объект-прототип - c#DownloadManager: upload the file to the cache section - androidAll Articles