template <typename Type>
class Stack
{
private:
int stack_size;
int array_capacity;
Type *array;
public:
Stack( int = 10 ); //??
~Stack();
bool empty() const;
Type top() const;
void push( const Type & );
Type pop();
};
template <typename Type>
Stack<Type>::Stack( int n ) :
stack_size( 0 ),
array_capacity( std::max(0, n) ),
array( new Type[array_capacity] )
{
// Empty constructor
}
This is an implementation of a stack using a one ended array, however bits of the code is confusing me.
I don't understand why it says int = 10
.
Please explain, thanks :)