This question already has an answer here:
- C++/CLI Converting from System::String^ to std::string 10 answers
I am having problem with converting managed System::String to std::string in C++/CLI. This code does not work, I can't understand why:
string SolvingUnitWrapper::getName(String ^name)
{
pin_ptr<const wchar_t> wstr = PtrToStringChars(name);
ostringstream oss;
oss << wstr;
return oss.str();
}
Thanks