in this question, sir has defined multiple types in the template but when he defines it in the private section of the class he defines the 2 vectors seperately… however when he uses the stack data structure, he used both the types in the same stack name…how can such a thing be done
Multiple type template
Hello @vector.9974 in this question he has defined one template and we can define that template as of any type string ,int ,char.
this is the actual meaning of the template.
like if at any point you change your datatype of the stack then you need not to change in the stack as well.
a change in T will change the whole data type of stack as well.
this is the actual meaning.
if you have any doubt you can ask here:
Happy Learning!!
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.