Guest User

Untitled

a guest
Oct 21st, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. class stack{
  4.     char *symbols;
  5.     int pnt;
  6. public:
  7.     stack( );
  8.     void push();
  9.     void print();
  10. };
  11. stack::stack( ){
  12.     char *symbols = new char[];
  13.     pnt = 0;
  14. };
  15. void stack::push(){
  16.     char value;
  17.     cout << "Enter a symbol: "; cin >> value;
  18.     *(symbols+pnt) = value;
  19.     pnt++;
  20. };
  21. void stack::print(){
  22.     for (int ix = pnt - 1; ix > 0; ix--)
  23.     {
  24.         cout << symbols [ix];
  25.     }
  26. };
  27.  
  28. int main(){
  29.     int num;
  30.      
  31.     stack a;
  32.     cout << "Enter a number of elements";
  33.     cin >> num;
  34.     a.push;
  35.      
  36.     system("pause");
  37. }
Advertisement
Add Comment
Please, Sign In to add comment