C Language Instruction Given Write Program Reverse String Using Stack Think Teacher Wants Q37103151

In C++ language, the only instruction that I was given was:/*Write a program to reverse a string using a stack.* This is whatI think my teacher wants but I can’t be sure. Thanks for thehelp!

#include <string>
#include <iostream>
using namespace std;

const int MAX_SIZE = 5;
int stackTop = -1;

class stackType {
private:
   int stack[MAX_SIZE];
public:
   bool isEmpty()
   {
       if (stackTop == -1)
           returntrue;
       else
           returnfalse;
   }
   bool isFull()
   {
       if (stackTop == MAX_SIZE – 1)
           returntrue;
       else
           returnfalse;
   }

   //This function checks if the stack is full. itadds an element onto the stack.
  

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.