c++ - Difference between System::Convert::ToString() and std::to_string()? -
I am a complete Noah in Visual C ++ programming, so I do not know whether it makes sense or not.
Well, I'm trying to change a label text to display in a form, so if I do this:
int value_a = 1; Int value_b = 2; System :: String ^ J; J = System :: Convert :: ToString (value_a) + "," + System :: Convert :: ToString (value_b); Label 1 - & gt; Text = j; It works perfectly, but when I tried to do this:
int value_a = 1; Int value_b = 2; System :: String ^ J; J = std :: to_string (valor1) + "," + std :: to_string (valor2); Label1-> Text = j; I get lots of errors ... what is the difference between using
string j; or
System :: string ^ j; between more functions
System :: Convert :: Toasting (); and
std :: to_string (); ????
system :: string ^ j; is a C ++ / CLI string that is the implementation of C ++ at the top of Microsoft's NAT framework so that you can communicate it with NIT languages (C #, VB.Net) and still use C + Able to use + ^ A garbage collective indicator used by C ++ / CLI means that gcnew std :: When using string, do not need to care about cleaning yourself C ++ version of the standard library wire. It can call it something like native C ++ . Every time you use the new with an indicator, you should not forget to call delete . System :: Convert :: Toasting is also Microsoft from C ++ / CLI. std :: to_string will be equal to C ++ 11 equivalent. Implementations are quite different, so you can not expect to get the same results with these different types.
Comments
Post a Comment