PDA

You are currently viewing a search engine-friendly (archive) version of this page.

View Full Version : Stacks in C++


pahjo
January 16, 2002, 08:26 pm
I need to add a function to return the number of items in the stack. How would this function work for an array-based stack and what would change for a pointer-based stack?

Also, how do I add a member function that adds up all the values in the stack using an array-based ADT stack of intergers?

Thank you for your time and responses.

Pahjo

MikeFoster
February 12, 2002, 02:23 pm
Hi pahjo, welcome to HelpFromTechs!

I apologize for not helping sooner. I'm not too much help in this forum - but I might be able to help with this.

Is this question just in general? Or do you already have a stack implementation that you're using?

I've got a few ADTs in C <a href="http://lineoflight.com/links/programming.html" target="_blank">here</a>. Looking at that code might be helpful. If you have any questions please post again.

Thanks