Go Down

Topic: modify 2D arrays (Read 544 times) previous topic - next topic

Hasi321

Feb 04, 2013, 10:22 pm Last Edit: Feb 04, 2013, 10:25 pm by Hasi321 Reason: 1
I tried a lot of stuff, but I don't know how to assign new values to arrays inside arrays efficiently. I know how to assign single values to one point of the 2D array, but I am working on a code, where it would use up most of the memory just assigning values.

Anyone has some suggestions for me?

Code: [Select]
int array [3] [2];  //initialzie a 2D array

void setup(){
 array[1] = {1,2}; //assign an array to the second part of the "root" array.
}

void loop(){
}



I would also be happy if i could reassign the whole 2D array, like:
array = {{2,3},{1,2},{4,5}};

AWOL

Have you considered using memcpy?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Hasi321


Have you considered using memcpy?


I am not sure what memcpy is...

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up