// Oldham, Jeffrey D. // 2000 Jan 28 // CS1321 #include #include // has EXIT_SUCCESS #include // has pair<...>() #include // has string int main() { std::pair o; // an empty pair std::pair p = pair("bye", 18); // create a string-int pair std::pair r = make_pair(string("aloha"), 19); // create 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? That is, do p and r have the 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; }