Well, here is my new stack program code. It needs a lot of work.
Printable View
Well, here is my new stack program code. It needs a lot of work.
oops.
thats better.Code:#include <iostream.h>
#include <conio.h>
const max=10;
int Max=10
push(char item, char stack, char top%)
if top < max
stack[top]=item;
top++;
else overflow;
return;
int Max=10
pop(char item, char stack, char top%)
if top <0
underflow;
else
top--;
item=stack[top];
stack[top]=0
return;
int main ()
char item
char choice
cout << "input function (A to add, B to delete.)
cin >>choice
if choice=A
push(item)
else pop(item)
That code doesn't even come close to compiling. Example, main needs curly braces.
Yeah I know. I had to essentialy throw out the old program because my teacher said it was to advanced for my class. Now I have this.
So fix it so it at least matches what C++ is supposed to look like.