Assigning an element of a multidimensional array to a second array I have two arrays. The first array is a multidimensional array holding color values. 

The 2nd array stores an active color from the 1st array. 
How can I assign an element from the multidimensional colors array to the 2nd EXCLUSIVE_COLOR array?

int colors[][3] = {
  { 255, 0, 0 },   
  { 0, 255, 0 },   
  { 0, 0, 255 },   
  { 253, 7, 210 }  
};
int EXCLUSIVE_COLOR[3] = {0};


I tried the following but neither seemed to work:

    EXCLUSIVE_COLOR = { 
      colors[0][0], 
      colors[0][1], 
      colors[0][2]
    };
    // error: assigning to an array from an initializer list

    EXCLUSIVE_COLOR = colors[0];
    // error: invalid array assignment
You can copy the array:

EXCLUSIVE_COLOR[0] = colors[0][0];
EXCLUSIVE_COLOR[1] = colors[0][1];
EXCLUSIVE_COLOR[2] = colors[0][2];


but this doesn't work in an initialization.

Alternatively, you can declare EXCLUSIVE_COLOR as a pointer to an
array of 3 integers:

int (*EXCLUSIVE_COLOR)[3]; // pointer to array 3 of int


Then you can have this point to a row of the 2D array, either by
assigning the pointer or in the initialization:

int (*EXCLUSIVE_COLOR)[3] = &amp;colors[0];  // initialization

// Later in the program:
EXCLUSIVE_COLOR = &amp;colors[1];


Note that when using this pointer, you will have to explicitly
dereference it:

for (int i = 0; i &lt; 3; i++)
    Serial.println((*EXCLUSIVE_COLOR)[i]);


Edit: As pointed out by Juraj in a comment, you can instead make
EXCLUSIVE_COLOR a pointer to int. In this case you will make it point
to the first element in the row you want:

int* EXCLUSIVE_COLOR = &amp;colors[0][0];


One nice thing of this approach is that you can use the “decay to
pointer” feature of the language to simplify the syntax:

int* EXCLUSIVE_COLOR = colors[0];

// Later
Serial.println(EXCLUSIVE_COLOR[i]);