GAH! this is giving me gray hairs. how the jeef do i write a class for a stack of type istream? i don't need a template, since this is only to be used for istream.
here's the basic stuff i have written so far:
count_ = the amount of stuff in the arrayCode:#ifndef _ISSTACK_H #define _ISSTACK_H #include <iostream.h> #include <fstream.h> class ISStack{ private: int count_, size_; istream **stack_; public: ISStack(); ISStack(const ISStack &); ~ISStack(); void push(istream *); istream* pop(); void increaseSize(); }; #endif;
size_ = maximum amount of stuff in the array
istream ** stack_ = the array of pointers to istreams
i have a copy constructor so i can pass this array of pointers by value, if necessary. i have a destructor because it's a dynamic data structure that needs to be deallocated when i'm finished with it. as this stands, ISStack(), ISStack(const ISStack &), ~ISStack, void push(istream *), and void increaseSize() work. it's the pop() that i'm having a trouble with.
is there anyone on this board who has written a class for istream stacks, or knows where i can get a nice and simple one? hell, even a plain-old stack class is fine, as long as it is VERY EASILY modifiable to support istreams and can compile using g++ 2.95.
thanks in advance
edk