/* arrayso1.cpp */ #include using namespace std; class Point { private: int x, y; public: Point() { } Point( int x0, int y0 ) : x(x0), y(y0) { } void set( int x0, int y0 ) { x = x0; y = y0; } int getX() { return x; } int getY() { return y; } void print() const { cout << "(" << x << "," << y << ") "; } }; int main() { Point *triagain = new Point[3]; assert( triagain != 0 ); triagain[0].set( 0,0 ); triagain[1].set( 0,3 ); triagain[2].set( 3,0 ); cout << "tri-ing again: "; for ( int i=0; i<3; i++ ) { triagain[i].print(); } cout << endl; delete[] triagain; }