Help. Microsoft Visual c++ 2010.

I'm using Microsoft visual c++ 2010 express and when I try to run this code:

1
2
3
4
5
6
7
8
			 int tal1 = 50;
			 int svar = 0;

			 String^ kebab;

			 kebab = System::Convert::ToInt32(textBox2->Text);
			 svar = kebab + tal1;
			 svar = System::Convert::ToString(label1->Text);


It returns this error:
'=' : cannot convert from 'int' to 'System::String ^'
'=' : cannot convert from 'System::String ^' to 'int'
'=' : cannot convert from 'System::String ^' to 'int'


can anyone help me out, please.
I'd say the errors are pretty clear in themselves.

the output is an integer so why are u trying to assign it into something else ?
int myint = System::Convert::ToInt32(textBox2->Text);

and vice versa
string mystring = System::Convert::ToString(label1->Text);
Last edited on
Topic archived. No new replies allowed.