Advertisement
ChaeYuriya

Week 7 : stack_character.h

Nov 3rd, 2024
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #define top(S) S.top
  3. #define info(S) S.info
  4. using namespace std;
  5.  
  6. const int MAXSTACK = 10;
  7. typedef char infotype;
  8.  
  9. struct stack {
  10.     infotype info[MAXSTACK];
  11.     int top;
  12. };
  13.  
  14. void createStack(stack &S);
  15. bool isEmpty(stack S);
  16. bool isFull(stack S);
  17. void push(stack &s,infotype x);
  18. void pop(stack &s,infotype &x);
  19. void printInfo(stack S);
  20. void ascending(stack &S);
  21. void descending(stack &S);
  22. void stringToStack(stack &S,const string &str);
  23. void reverseStack(stack &S);
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement