main.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* main.cpp :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2025/07/17 15:10:40 by bchanot #+# #+# */
  9. /* Updated: 2025/12/18 17:05:50 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "Animal.hpp"
  13. #include "Dog.hpp"
  14. #include "Cat.hpp"
  15. #include "CatWrong.hpp"
  16. #include "AnimalWrong.hpp"
  17. #include <iostream>
  18. #include <limits>
  19. int main( void ) {
  20. const AnimalWrong* meta = new AnimalWrong();
  21. const Animal* j = new Dog();
  22. const AnimalWrong* i = new CatWrong();
  23. std::cout << j->getType() << " " << std::endl;
  24. std::cout << i->getType() << " " << std::endl;
  25. i->makeSound(); //will output the cat sound!
  26. j->makeSound();
  27. meta->makeSound();
  28. return 0;
  29. }