Cpp クラス 継承 コンストラクタ 新しいページはコチラ
提供: yonewiki
(→クラス 継承 コンストラクタ) |
(→クラス 継承 コンストラクタ) |
||
88行: | 88行: | ||
public: | public: | ||
CDeriveInheritance(int iArgDeriveMoney, int iArgDeriveMonth, int iArgOptionMoney); | CDeriveInheritance(int iArgDeriveMoney, int iArgDeriveMonth, int iArgOptionMoney); | ||
+ | CDeriveInheritance(int iArgMoney, int iArgMonth) : CBaseInheritance(iArgMoney, iArgMonth) { printf("Constructor:CDriveInheritance(int,int)\n"); } | ||
~CDeriveInheritance(); | ~CDeriveInheritance(); | ||
void m_fvDeriveDispValue(); | void m_fvDeriveDispValue(); | ||
int m_fiDeriveSumMoney(); | int m_fiDeriveSumMoney(); | ||
+ | void m_fvSetDeriveOptionValue(int iArgOptionValue); | ||
}; | }; | ||
#endif | #endif | ||
+ | |||
</syntaxhighlight2> | </syntaxhighlight2> | ||
<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 start=600> | <syntaxhighlight2 lang="cpp" line start=600> | ||
− | #include | + | #include "pch.h" |
#include "DeriveInheritance.h" | #include "DeriveInheritance.h" | ||
105行: | 108行: | ||
m_iBaseMonth = iArgDeriveMonth; | m_iBaseMonth = iArgDeriveMonth; | ||
m_iOptionMoney = iArgOptionMoney; | m_iOptionMoney = iArgOptionMoney; | ||
+ | m_iDeriveMoney = 0; | ||
} | } | ||
114行: | 118行: | ||
int iSumMoney = m_fiDeriveSumMoney(); | int iSumMoney = m_fiDeriveSumMoney(); | ||
printf("DeriveMoney=%d\n", iSumMoney); | printf("DeriveMoney=%d\n", iSumMoney); | ||
+ | } | ||
+ | void CDeriveInheritance::m_fvSetDeriveOptionValue(int iArgOptionMoney) { | ||
+ | m_iOptionMoney = iArgOptionMoney; | ||
} | } | ||