Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
Line 93:
PolarPoint(double r = 1.0, double theta = 0.0): // Constructor, parameters with default values.
x{r * std::cos(theta)}, y{r * std::sin(theta)} /* <- Initializer list */ {
std::println("HelloPoint: x = {}, y = {}", x, y); // Constructor body
}
};