How to return reference
¶How to return reference
原文連結: https://darkblack01.blogspot.com/2012/08/how-to-return-reference.html
移植時的最後更新日期: 2015-12-23T14:16:57.694+08:00
Cartridge At(int i) const;
Cartridge CDataChain::At(int i) const
{
return m_CarChain1.at(0);
}
↓變成這樣寫 Cartridge& At(int i);
Cartridge& CDataChain::At(int i)
{
return m_CarChain1.at(0);
}
發表於
tags:
{ C_and_Cpp }