I\'m trying to create a map, where the key is an int, and the value is an array as follows:
int
int red[3] = {1,0,0}; int green[3] = {0,1,0}; int b
Don't map to an int[], instead, map to an int* like this:
#include #include using namespace std; int main(){ std::map colors; int red[] = {3,7,9}; colors[52] = red; cout << colors[52][1]; //prints 7 colors[52][1] = 11; cout << colors[52][1]; //prints 11 return 0; }