Introduction to OOP: Chapter 3: Classes and Methods: [next] [previous] [audio] [real] [text]

Constructors

Constructors tie together creation and initialization. Make sure every newly created object is initialized.


Card::Card (suits sv, int rv)
{
	s = sv;		// initialize suit
	r = rv;		// initialize rank
	faceup = true;	// initially face up
}
Intro OOP, Chapter 3, Slide 24