/*------------------------------------------------------------------------- | The software accompanies the paper | | | | Classes and Objects of Chemical Thermodynamics in Object-Oriented | | Programming. 2. A Class of Chemical Species | | | | E.B. Rudnyi | | E-mail: rudnyi@comp.chem.msu.su | | Homepages: http://www.chem.msu.su/~rudnyi/welcome.html | | | | presented at Second Electronic Computational Chemistry Conference, | | November 1995, http://hackberry.chem.niu.edu/ECCC2/ | --------------------------------------------------------------------------*/ #include #include "species.h" #include "memtst.h" void print_label(label& t) { if (t) cout << "label " << t << ", number of characters " << t.len() << endl << endl; else cout << "label is not determined" << endl << endl; } int main() { memory test; label a('[',']'); print_label(a); a = "[this is a test long label]"; label b = a; print_label(b); a = "this is a test long label"; print_label(a); do { cout << endl; cout << "Enter first label (start with [ and finish by ])" << endl; cin >> a; print_label(a); cout << "Enter second label (start with [ and finish by ])" << endl; cin >> b; print_label(b); cout << "results of comparisons" << endl; cout << "a < b is " << (a < b) << endl; cout << "a <= b is " << (a <= b) << endl; cout << "a == b is " << (a == b) << endl; cout << "a >= b is " << (a >= b) << endl; cout << "a > b is " << (a > b) << endl; } while (a && b); return 0; }