## 17.9 Example: Overloading the Subscript Operator (cont.)

>     class SafeArray
>     {
>     public:
>        SafeArray(int s);
>        SafeArray(const int v[], int s);
>        int& operator[](int i);
>        int operator[](int i) const;
>        private:
>        int size;
>        int* values;
>     };

>     SafeArray::SafeArray(int s) : size(s), values(new int[size]) {}

prev |top |next