// Example 62 #include #include using namespace std; // Class declaration... class sphere { public: double x_center, y_center, z_center, radius; // These are public data members. }; int main() { sphere ball; sphere BALL[10]; // Members are accessed with the . operator ball.x_center = 1.0; ball.y_center = 2.0; ball.z_center = -1.0; ball.radius = 5.0; // Objects can be assigned to objects. BALL[0] = ball; short k = 0; cout << "BALL[k] has center ( " << BALL[k].x_center << ", " << BALL[k].y_center << ", " << BALL[k].z_center << " )\n" << " and radius " << BALL[k].radius << endl; cout << "\n\n"; system( "PAUSE" ); return( EXIT_SUCCESS ); }