Let's say I have a fixed size 3 of array that stores the RGB of color. Example:
color[3] = {0, 0, 255}
and I have another array, arrayOfColors that stores many colors. Example:
arrayOfColors = { {0, 0, 255}, {0, 0, 0}, {255, 255, 255} }
I'm not sure what is the best way to do this but I've tried something. But I have errors when I do this approach. Please help me out, I'm very new to C language. Thank you in advance!
unsigned char color1[3] = {0, 0, 0};
unsigned char color2[3] = {0, 255, 255};
unsigned char *rowColors = NULL;
rowColors = (unsigned char*)malloc((2) * sizeof(char));
rowColors[0] = color1;
rowColors[1] = color2;