|
|
Our example library developer is the author of a fixed-size integer stack class called Stack. The contents of the header file for this class, Stack.h, are as follows:
Stack.h:
const int SIZE = 10;
class Stack {
public:
Stack();
void push(int);
int pop();
int top();
private:
int stack[SIZE];
int size;
};
The rest of this section illustrates how the library author can use Objections to implement simple error handling for the Stack library.