![]() ![]() ![]() | constructors-initialization-assignment/rect-ini.cc - Rectangle constructors - with initialization. | Lecture 4 - slide 8 : 41 Program 2 |
#include <cmath> #include <iostream> #include "rect.h" Rectangle::Rectangle(): upper_left(-1,1), lower_right(1,-1){ } Rectangle::Rectangle(Point p1, Point p2): upper_left(p1), lower_right(p2){ } Rectangle::Rectangle(double x1, double y1, double x2, double y2): upper_left(x1,y1), lower_right(x2,y2){ }