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 23:18:31 by kamitsui ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
21
#ifndef WRONGANIMAL_HPP
22
#define WRONGANIMAL_HPP
23
24
#include <
iostream
>
25
#include <
string
>
26
35
class
WrongAnimal
{
36
protected
:
37
std::string
type
;
38
39
public
:
40
WrongAnimal
();
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
std::string
WrongAnimal
The WrongAnimal class represents a generic animal, used to demonstrate the LACK of polymorphism when ...
Definition
WrongAnimal.hpp:35
WrongAnimal::WrongAnimal
WrongAnimal()
WrongAnimal::type
std::string type
Definition
WrongAnimal.hpp:37
WrongAnimal::operator=
WrongAnimal & operator=(const WrongAnimal &other)
WrongAnimal::getType
const std::string & getType() const
WrongAnimal::makeSound
void makeSound() const
WrongAnimal::~WrongAnimal
virtual ~WrongAnimal()
WrongAnimal::WrongAnimal
WrongAnimal(const WrongAnimal &other)
iostream
string
ex01
WrongAnimal.hpp
構築:
1.9.8