visual studio - Why following function cant be called with given argument list? -
void conver(double&, int&); private: system::void cb1_selectedindexchanged(system::object^ sender, system::eventargs^ e) { a=1; if ((a==1)&&(b2==1)) {if(cb1->text=="celsius") { input=system::convert::todouble(cel->text); if (cb2->text=="celsius") { choice=1; conver(input,choice); } if(cb2->text=="fahrenheit") } } }
i getting following error:
error: function "project3::myform::conver" cannot called given argument list. argument types are: (double, int)
i don't understand means. can't pass arguments reference in visual c++?
you passing actual number - not variable - reference. cannot pass in numbers reference because numbers not have addresses assigned in registry (memory). have use variable.
you can example:
int myfirstnumber = 1; int mysecondnumber = 1; conver(myfirstnumber, mysecondnumber);
Comments
Post a Comment