The constructor for this class could be defined, as usual, as:
|
Rectangle::Rectangle (int x, int y) { width=x; height=y; }
|
|
But it could also be defined using
member initialization as:
|
Rectangle::Rectangle (int x, int y) : width(x) { height=y; }
|
|
Or even:
|
Rectangle::Rectangle (int x, int y) : width(x), height(y) { }
|
|