tostring in .net 2005

inighthawki

Newcomer
Joined
Nov 29, 2005
Messages
14
im a very big vb.net fan, very experienced in it, and i decided to start trying C++, yes big jump but im looking through tutorials, but i also like to experiment, and a lot of times tutorials dont answer certain questions. I have it set so when u click a button, it loads a simple function that u preset 2 numbers, and it returns the larger value, and sets the form's title to the larger number. When i try it gives me a cannot convert int -> sting, so i use the .tostring after the function, and it gives me

error C2440: '=' : cannot convert from 'overloaded-function' to 'overloaded-function'

can someone help/show me how to get this working?

btw, this is the code:

Code:
public: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) 
			 {
				 this->Text = this->FindMax(1,2).ToString;

			 }

	int FindMax(int n1, int n2)
			{
				if (n1 > n2)
				{
					return n1;
				}
				else
				{
					return n2;
				}
			}
 
Back
Top