Chr.hに純粋仮想関数を継承したPlayer.hで定義と宣言を分けて書いるかどうか知りたい。PlayerクラスのUpdate(),Draw_Update()として書いてしまっているかそれともChr.hの関数の定義(Update(),draw_Update())を書いてあるかどうか知りたい。
教えてくれますでしょうか?
Chr.h
1#ifndef ___CHR_H 2#define ___CHR_H 3 4class Chr { 5public: 6 7 8 virtual void Update() = 0; 9 virtual void Draw_Update() = 0; 10 11 12}; 13 14#endif
Player.h
1#ifndef ___PLAYER_H 2#define ___PLAYER_H 3#include "Chr.h" 4class Player : Chr 5{ 6private: 7 int g_handle[7]; 8public: 9 10 Player(const char* str); 11 12 void Chr::Update(); 13 void Chr::Draw_Update(); 14 15 16}; 17 18#endif
Player.cpp
1#include "Input.h" 2#include "Player.h" 3#include "DxLib.h" 4 5 6Player::Player(const char* str) 7{ 8 //LoadDivGraph(); 9} 10 11 12void Player::Draw_Update() 13{ 14 //DrawFormatString(); 15} 16 17void Player::Update() 18{ 19 //DrawFormatString(); 20 21} 22
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/07/21 10:20
2019/07/21 10:38
退会済みユーザー
2019/07/21 10:50
2019/07/21 11:10
退会済みユーザー
2019/07/21 12:04
2019/07/21 12:35