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