1. operator*=:用于将一个COleCurrency对象乘以另一个COleCurrency对象。例如:
COleCurrency currency1(100, 0); // 100 units, 0 fractions
COleCurrency currency2(2, 50); // 2 units, 50 fractions
currency1 *= currency2; // currency1 现在变成 250 units, 0 fractions
2. operator/=:用于将一个COleCurrency对象除以另一个COleCurrency对象。例如:
COleCurrency currency1(150, 0); // 150 units, 0 fractions
COleCurrency currency2(3, 0); // 3 units, 0 fractions
currency1 /= currency2; // currency1 现在变成 50 units, 0 fractions
这些操作符允许你在COleCurrency对象之间执行乘法和除法运算,并且直接修改了左侧的操作数。
转载请注明出处:http://www.zyzy.cn/article/detail/21296/MFC/COleCurrency