Mar 20, 2014 at 4:43pm Mar 20, 2014 at 4:43pm UTC
i have a std string variable in which i want to enter system string^ value..
how to do it? how to convert?
example:
string a;
String^ b;
a = b; // its error since it cannot convert from System String^ to std string.
im trying:
a = Convert::ToString(b);
but im getting
error while trying to match the argument list '(std::string, System::String ^)'
Last edited on Mar 20, 2014 at 4:46pm Mar 20, 2014 at 4:46pm UTC
Mar 20, 2014 at 4:53pm Mar 20, 2014 at 4:53pm UTC
What is this System::String?
----------
If you manage to obtain a null-terminated char array you can construct a std::string from that.
Mar 20, 2014 at 6:05pm Mar 20, 2014 at 6:05pm UTC
actually im doing graphic programming with C++ (GUI-forms) applications
Last edited on Mar 20, 2014 at 6:07pm Mar 20, 2014 at 6:07pm UTC
Mar 20, 2014 at 6:13pm Mar 20, 2014 at 6:13pm UTC
Yes. Windows Forms is an API included with .NET. In order to use this API with C++, you actually are using C++/CLI instead of native C++. Hence, the System namespace and the caret ^ character to signify managed pointers (instead of * used for native pointers).