Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit3812e65c1c8c135934910618b1a917d431018fcf (patch)
Author
 Angel Dimitriev <angel_dimitriev@abv.bg>
2022-05-23 16:25:55 +0300
Committer
 GitHub <noreply@github.com>
2022-05-23 16:25:55 +0300
Filesb6f83396e079b212e224bedf222ad7a914256095
Object-oriented_programming_FMI-3812e65c1c8c135934910618b1a917d431018fcf.tar
Object-oriented_programming_FMI-3812e65c1c8c135934910618b1a917d431018fcf.tar.gz
Object-oriented_programming_FMI-3812e65c1c8c135934910618b1a917d431018fcf.zip
Parent31ee1d4bd2cb6096491a798d85d2abbdd5091fba (diff)
Update Shape.cpp
1 files changed, 3 insertions, 1 deletions
-rw-r--r--Sem. 12/Example_polymorphism/Shape.cpp4
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()
{