Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class INF> MyStack<INF>::MyStack(MyStack &st)
- {
- if(st.empty())
- top = nullptr;
- else {
- MyStack<INF> dub;
- Node*i = st.top;
- while(i!= nullptr)
- {
- dub.push(i->d);
- i = i->next;
- }
- i = dub.top;
- while(i!= nullptr)
- {
- push(i->d);
- i = i->next;
- }
- delete(i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement