int main()
{
	Name_pairs names;
	try
	{
		names.read_names();
		names.read_ages();
		std::cout << "Names and ages unordered:\n";
		cout << names;
		names.sort();
		std::cout << "Names and ages sorted by name:\n";
		cout << names;
	}
	catch (exception &e)
	{
		cout << "error: " << e.what() << std::endl;
		keep_window_open();
		return 1;
	}
	catch (...)
	{
		cout << "Unknown exeption!\n";
		keep_window_open();
		return 2;
	}

	keep_window_open();
	return 0;
}
Beispiel #2
0
int main()
{
    Name_pairs pairs;

    pairs.read_names();
    pairs.read_ages();

    pairs.print();

    pairs.sort();
    pairs.print();

    return 0;
}
Beispiel #3
0
int main()
{
	Name_pairs name;

	name.read_names();
	name.read_ages();

	name.print();

	name.sort();

	name.print();

	// keep window open
	char cc;
	cin >> cc;
}