CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Animal.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* Animal.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/05/20 16:24:30 by kamitsui #+# #+# */
9/* Updated: 2025/05/28 23:40:47 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
23#ifndef ANIMAL_HPP
24#define ANIMAL_HPP
25
26#include <iostream>
27#include <string>
28
38class Animal {
39 protected:
41
42 public:
44 Animal(const Animal &other);
45 Animal &operator=(const Animal &other);
46 virtual ~Animal();
47
55 virtual void makeSound() const = 0; // Pure virtual function
56 const std::string &getType() const;
57};
58
59#endif
The Animal class represents a generic animal.
Definition Animal.hpp:37
virtual ~Animal()
const std::string & getType() const
virtual void makeSound() const =0
Makes the sound appropriate for the animal.
Animal & operator=(const Animal &other)
Animal(const Animal &other)
std::string type
Definition Animal.hpp:39