previous
|
start
|
next
Default Constructors
The purpose of a constructor is to initialize
all
data fields of an object.
A constructor always has the same name as the class.
Product::Product() { price = 0; score = 0; }
Most default constructors initialize the data fields to zero, but not always.
The
Time
class initializes to current time.
Non-numeric data (e.g. string data) may have another value.
previous
|
start
|
next