Q:

C++ Look up table that returns an existing array of type struct

I have a number of existing arrays of a struct type 
typedef struct Patterns
{
    int a;
    int b;
    int c;
}

The arrays are named as follows

arr0, arr1, arr2, arr3, arr4, etc.

I am passed an integer value and would like to use it to look up the array that is needed and copy it to a temporary array.
i.e. int 0 corresponds to array arr0 and so on.
I've tried to use the "map" method but i run into the error "expression must be a modifiable lvalue" when assigning the arrays to the integer keys
std::map<int, Patterns[]>map1;

map1[0] = arr0;
map1[1] = arr1;

What am I doing wrong? Is there an easier way to quickly look up which array i need to utilize?

A:

use vector not array. You cant really create a map of pattern[].
You should have 
vector<vector<Pattern>> arrays;

arrays[0] = arr0;
arrays[1] = arr1;

etc.

