「✨」 feat(Ex00): working
This commit is contained in:
@ -6,32 +6,43 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/11/30 16:21:28 by adjoly #+# #+# */
|
||||
/* Updated: 2024/12/01 20:23:26 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/12/04 13:56:06 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "WrongAnimal.hpp"
|
||||
#include "cat.hpp"
|
||||
#include "dog.hpp"
|
||||
#include <iostream>
|
||||
|
||||
//int main(void) {
|
||||
// cat cutie;
|
||||
// dog dogo;
|
||||
//
|
||||
// cutie.makeSound();
|
||||
// dogo.makeSound();
|
||||
//}
|
||||
|
||||
int main() {
|
||||
const Animal* meta = new Animal();
|
||||
const Animal* j = new Dog();
|
||||
const Animal* i = new Cat();
|
||||
{
|
||||
const Animal* meta = new Animal();
|
||||
const Animal* dog = new Dog();
|
||||
const Animal* cat = new Cat();
|
||||
|
||||
std::cout << j->getType() << " " << std::endl;
|
||||
std::cout << i->getType() << " " << std::endl;
|
||||
i->makeSound(); //will output the cat sound!
|
||||
j->makeSound();
|
||||
meta->makeSound();
|
||||
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user