Class initialization: Constructor
It has been a long time since I worked on C++ so let’s start collecting all the questions that I have…
Rect::Rect( int x1, int y1, int x2, int y2 ) :
_topleft( x1, y1 ), _bottomright( x2, y2 ) {}
Why not this?
Rect::Rect( int x1, int y1, int x2, int y2 ) :
{
_topleft( x1, y1 );
_bottomright( x2, y2 );
}


Comments(4)