#include
#include
using namespace std;
const int SIZE = 10;
template class MyClass {
T a[SIZE];
public:
MyClass() {
register int i;
for(i=0; i }
T &operator[](int i);
};
template T &MyClass::operator[](int i)
{
if(i<0 || i> SIZE-1) {
cout << "\nIndex value of ";
cout << i << " is out-of-bounds.\n";
exit(1);
}
return a[i];
}
int main()
{
MyClass intob; // integer array
MyClass doubleob; // double array
for(int i=0; i for(int i=0; i
for(int i=0; i for(int i=0; i
return 0;
}