正在加载图片...
友元函数 15:06:48 class Byte int b public friend Byte operator++(Byte& bt) friend By te operator++(B bt. int) Byte operator++ byte bt bt b++. 前置形式 return bt. Byte operator+t byte bt, int) Byte temp=bt; bt b++ 后置形式 return tem p Byte btobirO) ++btob btob++15:06:48 .友元函数 class Byte{ int b; public: friend Byte operator++(Byte & bt); friend Byte operator++(Byte & bt,int); }; Byte operator++(Byte & bt){ bt.b++; return bt; } Byte operator++(Byte & bt,int){ Byte temp=bt; bt.b++; return temp; } Byte btObj(10); ++btObj; btObj++; 前置形式 后置形式
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有