Why wont this work?Code:#include <cstdlib> #include <iostream> using namespace std; class Stack { public: class Underflow { }; class Overflow { }; class Bad_Size { }; virtual void push(char c) = 0; virtual char pop() = 0; }; class Array_stack : public Stack { char *p; int max_size; int top; public: Array_stack(int s); ~Array_stack(); void push(char c); char pop(); }; Array_stack::Array_stack(int s) //cant compile { if(s > 10000) throw Bad_Size(); p = new char[s]; max_size = s; top = 0; } int main() { }
How can i define a constructor that's declared inside a derived class, but i want to define it outside of the class itself?



LinkBack URL
About LinkBacks


