Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit407398d44eaa5071a9166b42a86911d6438e1f3f (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2021-06-03 06:15:31 -0400
Committer
 GitHub <noreply@github.com>
2021-06-03 06:15:31 -0400
Filesb53e9f1fc5b340b6bf6ed958875bcb50448b2e4c
Object-oriented_programming_FMI-407398d44eaa5071a9166b42a86911d6438e1f3f.tar
Object-oriented_programming_FMI-407398d44eaa5071a9166b42a86911d6438e1f3f.tar.gz
Object-oriented_programming_FMI-407398d44eaa5071a9166b42a86911d6438e1f3f.zip
Parent3dbf662b6d81659203e2273109a0b657c2f71d8b (diff)
Update README.md
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);
+ }
}
```
От тук копирането става тривиално: