nclass
string {
n public:
n char & operator [] (int) const;
n •••
n};
n
nchar
& string::operator [] (int index) const {
n return str[index];
n}
n
nConsider
changing this to add
äbounds
checking
äprovide
access to “temporary” memory to ensure the “private” nature
of str’s memory.
n
n