Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #107.41K
[code]#include<iostream.h> #include<string.h> struct node { node*next; int data; }; class stack { private:node*top;node*top2;char c; public: stack() { top=NULL; top2=NULL; } void push(char c) { if(top==NULL) { top=new node; top->data=c; top->next=NULL; } else { node*temp=top; temp->data=c; temp->next=top; top=temp; } } void pop() { node*temp=top; char x=temp->data; cout<<x; top=top->next; delete temp; } … |