回答編集履歴
1
コードがあまりにも適当すぎた(継承すら書いてなかった)ので修正しました。
answer
CHANGED
@@ -13,13 +13,13 @@
|
|
13
13
|
|
14
14
|
class Base
|
15
15
|
{
|
16
|
-
|
16
|
+
protected:
|
17
17
|
ClassType type;
|
18
18
|
public:
|
19
19
|
ClassType GetType() { return type; }
|
20
20
|
};
|
21
21
|
|
22
|
-
class Sphere
|
22
|
+
class Sphere : public Base
|
23
23
|
{
|
24
24
|
public:
|
25
25
|
Sphere()
|
@@ -30,4 +30,6 @@
|
|
30
30
|
|
31
31
|
Sphere sphere;
|
32
32
|
shpere.GetType(); // SPHERE
|
33
|
-
```
|
33
|
+
```
|
34
|
+
|
35
|
+
コードがあまりにも適当すぎた(継承すら書いてなかった)ので修正しました。
|