Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

 

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;
			}
		}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...