https://ide.codingblocks.com/s/22746
int replaceSum(node*root)
In this function the return type is integer but when the function is called from the main there is no variable to accept it’s data. Is it legal? How?
https://ide.codingblocks.com/s/22746
int replaceSum(node*root)
In this function the return type is integer but when the function is called from the main there is no variable to accept it’s data. Is it legal? How?
Yes, it is legal. If you are willing to use the value returned by the function then you can get that value in some variable, but if you just want to call a function and don’t want to use its value… you can just call the function without initialising it to a variable.