This line is just an example of debugging lines...it is obvious that you don't understand the error.
|
cout << "Top of the queue: " << myStack.top() << endl;
|
This line has no point when you just copy it in main, you should put your own debugging code or tracing code for you to verify that your functions are working.
Now let me guide you on how to fix a compile error like this..
|
cout << "Top of the queue: " << myStack.top() << endl;
|
this line obviously causes the error. here is how to interpret the error description...
|
top is a private member of CircStack...
|
Upon looking at the description, you can then ask yourself, is there a member function or data in CircStack myStack having a name "top"? If the answer is non, then you should not put myStack.top() in the cout line above. Call a function supported by the CircStack class such as push(), pops(), peek(), and sizeStack(). Do you get it?
One more thing, your function CircStack::push() and CircStack::pops() are functions that have return type of type void which means nothing should be returned but you return something. Might as well remove the "return" or put a return type on those functions.