WinForms: Konvertierung funktioniert nicht!
-
Hallo!
Also guckt euch mal diesen Quelltext an:
int Zufall[6]; srand(timeGetTime()); Zufall[1]=(rand()%49)+1; do { Zufall[2]=(rand()%49)+1; }while (Zufall[2]==Zufall[1]); do { Zufall[3]=(rand()%49)+1; }while (Zufall[3]==Zufall[1]||Zufall[3]==Zufall[2]); do { Zufall[4]=(rand()%49)+1; }while (Zufall[4]==Zufall[1]||Zufall[4]==Zufall[2]||Zufall[4]==Zufall[3]); do { Zufall[5]=(rand()%49)+1; }while (Zufall[5]==Zufall[1]||Zufall[5]==Zufall[2]||Zufall[5]==Zufall[3]||Zufall[5]==Zufall[4]); do { Zufall[6]=(rand()%49)+1; }while (Zufall[6]==Zufall[1]||Zufall[6]==Zufall[2]||Zufall[6]==Zufall[3]||Zufall[6]==Zufall[4]||Zufall[6]==Zufall[5]); label1->Text=Int32::ToString(Zufall[1]);
Nun:
In der letzten Zeile bekomme ich ne Fehlermeldung.
Wie muss ich eigentlich konvertieren??
Int32::ToString geht leider nicht!Danke!
-
*sorry blödsinn*
-
Zufall[l].ToString();
PS: Besseres Forum: C++/CLI...
-
Dieser Thread wurde von Moderator/in estartu aus dem Forum MFC (Visual C++) in das Forum C++/CLI mit .NET verschoben.
Im Zweifelsfall bitte auch folgende Hinweise beachten:
C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?Dieses Posting wurde automatisch erzeugt.
-
label1->Text = System::String::Format("{0:D}", Zufall[1]); //evtl. auch label1->Text = System::String::Empty; label1->Text += Zufall[1];