Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 12 insertions, 11 deletions
-rw-r--r--Sem. 14/README.md23
diff --git a/Sem. 14/README.md b/Sem. 14/README.md
index 5f4ec83..f98e951 100644
--- a/Sem. 14/README.md
+++ b/Sem. 14/README.md
@@ -10,7 +10,7 @@ struct Fruit
virtual void printColor() const = 0;
virtual ~Fruit(){}
-}
+}
```c++
struct Apple
{
@@ -54,8 +54,8 @@ public:
~FruitStore();
void addApple();
- void addOrange();
- void addLemon(size_t sourness);
+ void addOrange();
+ void addLemon(size_t sourness);
}
void FruitStore::addApple
@@ -96,7 +96,7 @@ struct Fruit
virtual void printColor() const = 0;
virtual ~Fruit(){}
- virtual Fruit* clone() const = 0; //!
+ virtual Fruit* clone() const = 0; //!
}
```c++
struct Apple
@@ -107,21 +107,22 @@ struct Apple
}
Fruit* clone() const override
{
- return new Apple(*this);
- }
+ return new Apple(*this);
+ }
}
struct Orange
{
- void printColor() const override
+ void printColor() const override
{
std::cout << "Orange! "<<std::endl;
}
+
Fruit* clone() const override
{
- return new Apple(*this);
- }
+ return new Apple(*this);
+ }
}
struct Lemon
{
@@ -134,8 +135,8 @@ struct Lemon
}
Fruit* clone() const override
{
- return new Lemon(*this);
- }
+ return new Lemon(*this);
+ }
}
```
От тук копирането става тривиално: