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
EXCLUSIVE_COLOR
. you want a pointer to the array or a copy of the array?int* EXCLUSIVE_COLOR = colors[0];
. and then you can useEXCLUSIVE_COLOR[i]
Color
elements in reality?