From 3812e65c1c8c135934910618b1a917d431018fcf Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Mon, 23 May 2022 16:25:55 +0300 Subject: Update Shape.cpp --- Sem. 12/Example_polymorphism/Shape.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Sem. 12/Example_polymorphism/Shape.cpp') diff --git a/Sem. 12/Example_polymorphism/Shape.cpp b/Sem. 12/Example_polymorphism/Shape.cpp index 27bb9e9..468c621 100644 --- a/Sem. 12/Example_polymorphism/Shape.cpp +++ b/Sem. 12/Example_polymorphism/Shape.cpp @@ -8,9 +8,11 @@ Shape::Shape(size_t pointsCount) : pointsCount(pointsCount) void Shape::copyFrom(const Shape& other) { points = new point[other.pointsCount]; - + for (int i = 0; i < other.pointsCount; i++) points[i] = other.points[i]; + + pointsCount = other.pointsCount; } void Shape::free() { -- cgit v1.3.1-23-gd82d