Passing a variables as a default parameters in function c++ -
Passing a variables as a default parameters in function c++ -
this question has reply here:
how utilize fellow member variable default argument in c++? 3 answerswhy doesnt c++ allow
void insertdata (t data1,tree<t> *tree=treetop);
passing value default parameter allowed why not variable default paramaeter....??
class binarytree { private : tree<t> *treetop; unsigned int numberofelements; public : void insertdata (t data1,tree<t> *tree=treetop); // prototype question purpose }
you create overload this:
void insertdata(t data1) { insertdata(data1, treetop); } void insertdata(t data1, tree<t> *tree) { // code }
c++ function default-value
Comments
Post a Comment