Kurze Frage, Dringend!
-
Ich möchte einen Integerwert in einen String speichern. So klappts schon mal nicht. Wie geht das denn???
int i;
String^ str = " ";
str=i;error C2440: '=' : cannot convert from 'int' to 'System::String ^'
Danke!
-
Casten
Entweder klassisch (c/c++ Form):
int i; String^ st = " "; i = (int)st;
oder schau den Thread dynamic_cast weiter unten an.
Besser dürfte save_cast sein.
-
error C2440: 'type cast' : cannot convert from 'System::String ^' to 'int'
1>
a type representing an address in the gc heap can only be converted to integral type via pinningich schau mir mal die anderen möglichkeiten an....
-
str=i.ToString();
Danke für Eure Hilfe!