Project finished
This commit is contained in:
@@ -6,13 +6,15 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/08 17:43:10 by hadi #+# #+# */
|
||||
/* Updated: 2025/11/09 21:49:36 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/11/10 10:33:20 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "Animal/Animal.hpp"
|
||||
#include "Dog/Dog.hpp"
|
||||
#include "Cat/Cat.hpp"
|
||||
#include "WrongAnimal/WrongAnimal.hpp"
|
||||
#include "WrongCat/WrongCat.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -20,20 +22,24 @@ int main()
|
||||
const Animal* meta = new Animal();
|
||||
const Animal* j = new Dog();
|
||||
const Animal* i = new Cat();
|
||||
const WrongAnimal* z = new WrongCat();
|
||||
|
||||
std::cout << std::endl << "----- Getting types ------" << std::endl;
|
||||
std::cout << j->getType() << " " << std::endl;
|
||||
std::cout << i->getType() << " " << std::endl;
|
||||
|
||||
std::cout << std::endl << "----- Making sounds ------" << std::endl;
|
||||
i->makeSound();
|
||||
std::cout << std::endl << "----- Animal sounds ------" << std::endl;
|
||||
|
||||
std::cout << j->getType() << " says: ";
|
||||
j->makeSound();
|
||||
meta->makeSound();
|
||||
|
||||
std::cout << std::endl << i->getType() << " says ";
|
||||
i->makeSound();
|
||||
|
||||
std::cout << std::endl << z->getType() << " says ";
|
||||
z->makeSound();
|
||||
|
||||
std::cout << std::endl << "----- Free all! ------" << std::endl;
|
||||
delete (meta);
|
||||
delete (j);
|
||||
delete (i);
|
||||
delete (z);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user