diff --git a/StackRev1 b/StackRev1 new file mode 100644 index 0000000..f104a71 --- /dev/null +++ b/StackRev1 @@ -0,0 +1,67 @@ +// C++ program to reverse a string using stack +#include + +using namespace std; + +//Class to implement Stack +class Stack +{ + private: + char * a; + public: + int t; + void pop(); + void push(char b); + bool empty(); + Stack(int size) + { + a= new char[size]; + t=-1; + } +}; + +// Class to print out element +void Stack::pop() +{ + if(empty()) + { + cout<<"Empty Stack"<