Homework Solution 1: stack.cc
#include <iostream.h>
#include "stack.h"
// Constructor: initialize the stack size to 0
stack::stack()
{
stack_size = 0;
}
// Accessor function to return the number of items on the stack
int stack::size()
{
return stack_size;
}
Previous slide
Next slide
Back to first slide
View graphic version