Cpp クラス 継承 アップキャスト 新しいページはコチラ
提供: yonewiki
(→クラス 継承 アップキャスト) |
(→クラス 継承 アップキャスト) |
||
66行: | 66行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>基底クラス BaseInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>基底クラス BaseInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=100> |
#include "pch.h" | #include "pch.h" | ||
#include "BaseInheritance.h" | #include "BaseInheritance.h" | ||
107行: | 107行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>派生クラス DeriveInheritance.h<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>派生クラス DeriveInheritance.h<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=200> |
#ifndef __DERIVEINHERITANCE_H_YONET__ | #ifndef __DERIVEINHERITANCE_H_YONET__ | ||
#define __DERIVEINHERITANCE_H_YONET__ | #define __DERIVEINHERITANCE_H_YONET__ | ||
132行: | 132行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>派生クラス DeriveInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>派生クラス DeriveInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=300> |
#include "pch.h" | #include "pch.h" | ||
#include "DeriveInheritance.h" | #include "DeriveInheritance.h" | ||
182行: | 182行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>配列入力の派生クラス DeriveArrInheritance.h<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>配列入力の派生クラス DeriveArrInheritance.h<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=400> |
#ifndef __DERIVEARRINHERITANCE_H_YONET__ | #ifndef __DERIVEARRINHERITANCE_H_YONET__ | ||
#define __DERIVEARRINHERITANCE_H_YONET__ | #define __DERIVEARRINHERITANCE_H_YONET__ | ||
210行: | 210行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>配列入力の派生クラス DeriveArrInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>配列入力の派生クラス DeriveArrInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=500> |
#include "pch.h" | #include "pch.h" | ||
#include "DeriveArrInheritance.h" | #include "DeriveArrInheritance.h" | ||
269行: | 269行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>割引の派生クラス DeriveDiscountInheritance.h<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>割引の派生クラス DeriveDiscountInheritance.h<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=600> |
#ifndef __DERIVEDISCOUNTINHERITANCE_H_YONET__ | #ifndef __DERIVEDISCOUNTINHERITANCE_H_YONET__ | ||
#define __DERIVEDISCOUNTINHERITANCE_H_YONET__ | #define __DERIVEDISCOUNTINHERITANCE_H_YONET__ | ||
295行: | 295行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>割引の派生クラス DeriveDiscountInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>割引の派生クラス DeriveDiscountInheritance.cpp<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=700> |
#include "pch.h" | #include "pch.h" | ||
#include "DeriveDiscountInheritance.h" | #include "DeriveDiscountInheritance.h" | ||
338行: | 338行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>メイン関数 InheritanceMain.cpp<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>メイン関数 InheritanceMain.cpp<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=800> |
#include "pch.h" | #include "pch.h" | ||
#include "BaseInheritance.h" | #include "BaseInheritance.h" | ||
373行: | 373行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">実行結果<!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">実行結果<!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="text" line> | + | <syntaxhighlight2 lang="text" line start=900> |
Constructor:CBaseInheritance(int,int) | Constructor:CBaseInheritance(int,int) | ||
BaseMoney=46800 | BaseMoney=46800 | ||
405行: | 405行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>メイン関数 InheritanceMain.cpp<span>)</span><!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">cpp <span>(</span>メイン関数 InheritanceMain.cpp<span>)</span><!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="cpp" line> | + | <syntaxhighlight2 lang="cpp" line start=1000> |
#include "pch.h" | #include "pch.h" | ||
#include "BaseInheritance.h" | #include "BaseInheritance.h" | ||
448行: | 448行: | ||
<span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">実行結果<!-- padding 上 右 下 左--> | <span style="color: #ffffff; background-color: #555555; padding: 0px 5px 0px 5px; display: inline-block;">実行結果<!-- padding 上 右 下 左--> | ||
− | <syntaxhighlight2 lang="text" line> | + | <syntaxhighlight2 lang="text" line start=1100> |
Constructor:CBaseInheritance(int,int) | Constructor:CBaseInheritance(int,int) | ||
Constructor:CDriveInheritance(int,int) | Constructor:CDriveInheritance(int,int) |