术语 | COleCurrency::Relational Operators |
释义 | COleCurrency 关系操作符 BOOL operator ==( const COleCurrency& cur ) const; BOOL operator !=( const COleCurrency& cur ) const; BOOL operator <( const COleCurrency& cur ) const; BOOL operator >( const COleCurrency& cur ) const; BOOL operator <=( const COleCurrency& cur ) const; BOOL operator >=( const COleCurrency& cur ) const; 说明: 这些操作符比较两个货币值,如果条件为真,则返回非零值,否则为0。 注意: 如果有一个操作数的状态为空或无效,排序操作符(<, <=, >, >=)的返回值未定义。等值操作符(==, !=)是操作数的状态而定。 示例: COleCurrency curOne(3, 5000); // 3.5 COleCurrency curTwo(curOne); // 3.5 BOOL b; b = curOne == curTwo; // TRUE curTwo.SetStatus(COleCurrency::invalid); b = curOne == curTwo; // FALSE, different status b = curOne != curTwo; // TRUE, different status b = curOne < curTwo; // FALSE, same value b = curOne > curTwo; // FALSE, same value b = curOne <= curTwo; // TRUE, same value b = curOne >= curTwo; // TRUE, same value 注意:最后四行在调试模式中将会发出声明警告。 请参阅:COleCurrency::GetStatus |
随便看 |
|
MFC类库中文详解手册包含4274条MFC类库参考词条,基本涵盖了Microsoft基本类库中的类、全局函数、全局变量和宏的内容,是计算机编程的有利工具。