Default Constructor Parameter Values - C++ Class

C++ examples for Class:Constructor

Description

Default Constructor Parameter Values

class Pool {
private:
  double length;
  double width;
  double height;

public:
  // Constructors
  Pool(double lv = 1.0, double wv = 1.0, double hv = 1.0);
  Pool();                                            // No-arg constructor

  double volume();                                  // Function to calculate the volume of a pool
};

Related Tutorials