#include <iostream>
using namespace std;
class MyClass {
double a, b;
public:
MyClass(double x, double y) {
a = x;
b = y;
}
void show() { cout << a << ' ' << b << '\n'; }
};
int main()
{
MyClass ob[2][5] = {
MyClass(1, 1), MyClass(2, 2),
MyClass(3, 3), MyClass(4, 4),
MyClass(5, 5), MyClass(6, 6),
MyClass(7, 7), MyClass(8, 8),
MyClass(9, 9), MyClass(10, 10)
};
MyClass *p;
p = (MyClass *) ob;
int i, j;
for(i = 0; i <2; i++)
for(j=0; j<5; j++) {
p->show();
p++;
}
cout << '\n';
return 0;
}
|