S
sparks
I am about to pull my hair out on this one.
its a class stack with push and pop
but one time its trying to find a }
at the end of the code
the next it says that I need a } after private
man I know I am kinda new but this is driving me
up the wall ....
Should I start over or what.
I keep adding things trying to get it to work but no success.
thanks for any and ALL help
Sparks
class Stack
{
public:
StackOP( int = 30 );
void push(float val);
float pop();
int num_items() const;
int full() const;
int empty() const;
private:
int size;
float *top;
float *bottom;
int N=30;
Stack::StackOP() //should this be (int N)????
{
bottom = new float[N];
top = bottom;
size = N;
}
Stack::StackOP()
{
delete [] bottom;
}
Stack::num_items()const
{
return (top-bottom);
}
Stack:ush()
{
*top == val;
top++;
}
Stack:op()
{
top--;
}
};
its a class stack with push and pop
but one time its trying to find a }
at the end of the code
the next it says that I need a } after private
man I know I am kinda new but this is driving me
up the wall ....
Should I start over or what.
I keep adding things trying to get it to work but no success.
thanks for any and ALL help
Sparks
class Stack
{
public:
StackOP( int = 30 );
void push(float val);
float pop();
int num_items() const;
int full() const;
int empty() const;
private:
int size;
float *top;
float *bottom;
int N=30;
Stack::StackOP() //should this be (int N)????
{
bottom = new float[N];
top = bottom;
size = N;
}
Stack::StackOP()
{
delete [] bottom;
}
Stack::num_items()const
{
return (top-bottom);
}
Stack:ush()
{
*top == val;
top++;
}
Stack:op()
{
top--;
}
};