Binary Operators - Relational


The binary relational operators:

image from book

 , <=, ==, !=, > and >= 

image from book

may be extendible to user defined data types They would not be meaningful on the complex class but they would be as member operators on the Date class.

For example:

image from book

 if(date1 <= 12/31/2006)    cout << "The date was before the end of 2006"         << endl; 

image from book

Notice how these operators are using in the following program: datereln.cpp

Observe that the output of each of these relational operations in this program is not a class object but a variable of the bool data type. Thus the explicit argument and the output are not required to be class objects and can be any data type.




Intermediate Business Programming with C++
Intermediate Business Programming with C++
ISBN: 738453099
EAN: N/A
Year: 2007
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net