CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
WrongAnimal.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* WrongAnimal.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/05/20 16:26:33 by kamitsui #+# #+# */
9/* Updated: 2025/05/20 20:44:15 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
21#ifndef WRONGANIMAL_HPP
22#define WRONGANIMAL_HPP
23
24#include <iostream>
25#include <string>
26
36 protected:
38
39 public:
41 WrongAnimal(const WrongAnimal &other);
42 WrongAnimal &operator=(const WrongAnimal &other);
43 virtual ~WrongAnimal();
44
45 void makeSound() const;
46 const std::string &getType() const;
47};
48
49#endif
The WrongAnimal class represents a generic animal, used to demonstrate the LACK of polymorphism when ...
WrongAnimal()
Default constructor for WrongAnimal. Initializes the type to "Generic WrongAnimal"....
std::string type
WrongAnimal & operator=(const WrongAnimal &other)
Copy assignment operator for WrongAnimal. Assigns the type from the other WrongAnimal object....
const std::string & getType() const
Gets the type of the WrongAnimal.
void makeSound() const
Makes a generic sound for a WrongAnimal. This function is intentionally NOT VIRTUAL to show the lack ...
virtual ~WrongAnimal()
Destructor for WrongAnimal. Displays a destruction message. Note: Declared virtual in the header to e...