inighthawki Posted July 8, 2006 Posted July 8, 2006 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; } } Quote
inighthawki Posted July 8, 2006 Author Posted July 8, 2006 sry nm, i figured out my problem...simply needed the () after tostring... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.