I am having issues with one of my programs and here are theinstructions. Use one
ID: 3618889 • Letter: I
Question
I am having issues with one of my programs and here are theinstructions. Use one of the stack classes in a program thatreads a string, one character at a time and deermines whether thestring contains balanced parenthesis, that is foe each parenthesisthere is exactly one watching right parenthesis later in thestring...This is what I have and dont think it is right...#include <iostream>
#ifndef DSTACK
#define STACK
typedef int StackElement;
class Stack;
{
public:
//*****Function members*****
Stack(int numElements = 128);
Stack(string numElements = 128);
private:
int myCapacity, my top;
StackElement * myArray;
} //end of class declaration
#end if
Explanation / Answer
please rate - thanks you're looking for C, but I don't know how to do the pointers. this should give you an idea it's in C++ #include using namespace std; char pop(char[], int& ); void push(char[],int&,int, char) ; bool checkinput(string,int,char[]); int main() { int maxsize=20; char stack[maxsize]; string input; bool good; coutinput; good=checkinput(input,maxsize,stack); if(good) coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.