// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <array>

using namespace std;

int main()
{
    try
    {
        array<int,2> a;
        for(int i = 0; i < 3; i++)
        {
            a.at(i) = i + 1;
            cout << i << " : " << a.at(i) << endl;
        }
    }
    catch(const out_of_range& oor)
    {
        cout << oor.what() << endl;
    }
    return 0;
}

