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 answers

why 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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -