Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Farm(cloneFunction) / Farm.hpp
diff options
context:
space:
mode:
Commitabf529bc12fb952692e2426d65e39ecbde8a11d4 (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-24 00:03:33 +0300
Committer
 GitHub <noreply@github.com>
2019-09-24 00:03:33 +0300
Filesa3fec43eb8ba4f42139b95ad5d5892143283814d /Polymorphism/Farm(cloneFunction)/Farm.hpp
Object-oriented_programming_FMI-abf529bc12fb952692e2426d65e39ecbde8a11d4.tar
Object-oriented_programming_FMI-abf529bc12fb952692e2426d65e39ecbde8a11d4.tar.gz
Object-oriented_programming_FMI-abf529bc12fb952692e2426d65e39ecbde8a11d4.zip
Parent78fca35e6571e60156c80d40063dfc92cf5ba1ff (diff)
Add files via upload
1 files changed, 5 insertions, 2 deletions
-rw-r--r--Polymorphism/Farm(cloneFunction)/Farm.hpp7
diff --git a/Polymorphism/Farm(cloneFunction)/Farm.hpp b/Polymorphism/Farm(cloneFunction)/Farm.hpp
index 5dc7cc8..0d9e5e8 100644
--- a/Polymorphism/Farm(cloneFunction)/Farm.hpp
+++ b/Polymorphism/Farm(cloneFunction)/Farm.hpp
@@ -1,5 +1,7 @@
#include "Animal.hpp"
-
+#include "Cat.hpp"
+#include "Dog.hpp"
+#include "Cow.hpp"
// Collection of all animals
class Farm
{
@@ -46,7 +48,7 @@ bool Farm::AddAnimal(Animal* an)
{
if(count == len)
return false;
- animals[count++]=c;
+ animals[count++]=an;
return true;
}
bool Farm::AddCat(std::string name)
@@ -96,3 +98,4 @@ void Farm::CopyFrom(const Farm& other)
len = other.len;
count = other.count;
}
+