I am trying to create a random number generator in C++, which puts the result in a textBox.
I get the error 'error C2440: 'initializing' : cannot convert from 'std::basic_string<_Elem,_Traits,_Ax>' to 'System::String ^
My code is:
int rnd = 1 + rand() % 100;
std::ostringstream convert;
convert << rnd;
String ^ num = convert.str();
textBox1->Text = num;
What am I doing wrong?
String ^ num = ...is not C++. - juanchopanza