// // example of using STL "vector" template class // // input: none. // output: results of calling some functions. // // Oldham, Jeffrey D. // 2000 Jan 28 // CS1321 // Modified by: // Massingill, Berna L. // 2001 Sep #include #include // has EXIT_SUCCESS #include // has vector #include // has string using namespace std; int main() { pair o; // Creates an empty pair (to hold a // string and an int). pair p("bye", 18); // Creates a string-int pair. pair r = make_pair(string("aloha"), 19); // Creates another string-int pair. cout << "The pair p contains " << p.first << " and " << p.second << ".\n"; cout << "The pair r contains " << r.first << " and " << r.second << ".\n"; cout << "Are p and r are equal (same contents)? "; if (p == r) cout << "yes\n"; else cout << "no\n"; cout << "Copy r's contents to p and then check if r not equal to p: "; p = r; if (r != p) cout << "not equal\n"; else cout << "equal\n"; return EXIT_SUCCESS; }