Converting std::string to Unicode String in c++
c++, c++builder, string, unicode
Solution
Form1->Memo1->Lines->Add("some text "+infstring.c_str()+" some text");
should be
Form1->Memo1->Lines->Add(("some text "+infstring+" some text").c_str());
i.e. you add the string literals to the `std::string` then use `c_str()` to get a `const char*` from it.
That still won't work if the `Add()` function takes a different type, but you haven't given enough information to know what you're asking about.
Problem
I have a problem. I need to convert string type to unicode. I know metod like ``` string.c_str(); ``` but it doesn't work in my code. I have function ``` void modify(string infstring, string* poststring) ``` and in it i need to display infstring in memo. Like a ``` Form1->Memo1->Lines->Add("some text "+infstring.c_str()+" some text"); ``` but compiler says me "E2085 Invalid Pointer addition" How can i solve my problem?