I am programming for the Arduino. I want to use an array, but I want to change the contents of the array, while the code is running with the same code I used to initialize the array:
I can do this:
boolean framebuffer[6][5] = {
{0,0,1,0,0},
{0,0,0,1,0},
{0,0,1,0,0},
{0,1,0,0,0},
{1,0,0,0,0},
{1,1,1,1,1}
};
But I can’t do this:
framebuffer = {
{0,0,1,0,0},
{0,0,0,1,0},
{0,0,1,0,0},
{0,1,0,0,0},
{1,0,0,0,0},
{1,1,1,1,1}
};
Is there any possibility to set the array content like this? I don’t want assign each array element individually, like this:
framebuffer[0][0] = 0;
You can’t directly do it like that, but you can have all your arrays predefined, then
memcpythem toframebuffer: