Thread: LIFO in Array
View Single Post
  #3 (permalink)  
Old April 22nd, 2004, 01:17 PM
nikolai nikolai is offline
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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/
Reply With Quote