CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Cat.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* Cat.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/05/20 16:25:54 by kamitsui #+# #+# */
9/* Updated: 2025/05/20 20:43:55 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
21#ifndef CAT_HPP
22#define CAT_HPP
23
24#include "Animal.hpp" // Inherits from Animal
25
33class Cat : public Animal {
34 public:
35 Cat();
36 Cat(const Cat &other);
37 Cat &operator=(const Cat &other);
38 virtual ~Cat();
39
40 virtual void makeSound() const;
41};
42
43#endif
The Animal class represents a generic animal.
Definition Animal.hpp:37
The Cat class represents a feline animal.
Definition Cat.hpp:33
virtual void makeSound() const
Makes the characteristic sound of a cat ("Meow!"). This function overrides the virtual makeSound() fr...
Definition Cat.cpp:65
Cat & operator=(const Cat &other)
Copy assignment operator for Cat. (Copy And Swap Idiom) Displays a specific copy assignment message.
Definition Cat.cpp:53
virtual ~Cat()
Destructor for Cat. Displays a specific destruction message.
Definition Cat.cpp:45
Cat()
Default constructor for Cat. Calls the Animal base class constructor and sets the type to "Cat"....
Definition Cat.cpp:28
Declares the abstract Animal base class.