Thread
:
LIFO in Array
View Single Post
#
3
(
permalink
)
April 22nd, 2004, 01:17 PM
nikolai
Friend of Wrox
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
I forgot one very important thing: The stack constructor SHOULD initialize top_ to -1.
class IntStack
{
public:
IntStack() : top_(-1) { /* empty */ }
...
};
Take care,
Nik
http://www.bigaction.org/
nikolai
View Public Profile
Find all posts by nikolai