CPP03 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
ClapTrap.hpp ファイル

Header file for the ClapTrap class. [詳解]

#include <iostream>
#include <string>
ClapTrap.hpp の依存先関係図:
被依存関係図:

[ソースコード]

クラス

class  ClapTrap
 Represents a basic robot character. [詳解]
 

詳解

Header file for the ClapTrap class.

This file declares the base class ClapTrap, representing a basic robot. Compared to EX00, significant improvements include:

  • Introduction of protected access specifier for member variables, allowing derived classes direct access.
  • Declaration of the destructor as virtual, crucial for proper cleanup in inheritance hierarchies.
  • Declaration of the attack() function as virtual, enabling polymorphism and allowing derived classes to override its behavior.
  • Addition of a getName() getter, facilitating access to the name from derived classes.

ClapTrap.hpp に定義があります。