1
0
This repository has been archived on 2025-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_04/ex00/main.cpp

47 lines
1.5 KiB
C++
Raw Normal View History

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/30 16:21:28 by adjoly #+# #+# */
2024-12-06 16:06:57 +01:00
/* Updated: 2024/12/06 16:02:36 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
2024-12-04 14:01:52 +01:00
#include "WrongAnimal.hpp"
2024-12-06 16:06:57 +01:00
#include "Cat.hpp"
#include "Dog.hpp"
int main() {
2024-12-04 14:01:52 +01:00
{
const Animal* meta = new Animal();
const Animal* dog = new Dog();
const Animal* cat = new Cat();
log("", "Animal/Cat", "Type", cat->getType());
log("", "Animal/Dog", "Type", dog->getType());
cat->makeSound(); //will output the cat sound!
dog->makeSound();
meta->makeSound();
delete meta;
delete cat;
delete dog;
}
{
const WrongAnimal* meta = new WrongAnimal;
const WrongAnimal* wrongcat = new WrongAnimal;
log("", "Animal/WrongCat", "Type", wrongcat->getType());
wrongcat->makeSound();
delete meta;
delete wrongcat;
}
return 0;
}