2- and why the program is giving the error in the code when i dint used & operator
3- why it is giving error in * operator instead of & please explain me i am not able to understand it
1-please tell me why u used & operator in reverse (stack<int> & s) ): AND DONT SAY REFENCE IS PASSED PLEASE EXPLAIN PROPERLY I AM NOT UNDERSTANDING WHAT IS REFERENCE?
@kailash_01 hi,basically in c++ refernces are used ,generally kya hota haio jab app function me stack pass krrhe ho without reference to function apna nya stack bnata hai aur usme changes krta hai but original stack jo hmne pass kia tha usme koi change nhi hota ,so if we want ki hmare original stack me change ho uske lie hm reference use kia ,just & operator lga do ab jo bhi change honge function ke andr woh original stack s me honge apko kuch return krne ki bhi need nhi.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.