What is the fastest way to fill a static multidimensional array?

Looping over all dimension's elements sounds inefficient, especially as a
static array is essentially continuous memory.
What is the best practice?

int[2][2][2] arr = 0;
arr[] = 3; //Error: cannot implicitly convert expression (3) of type int to
int[2u][2u][]
arr[][][] = 3; // this would be fine too :)

int[2][2][2] arr2 = [[[1,2],[3,4]],[[5,6],[7,8]]];

Somehow I find it surprising that this copies the whole array.
arr[] = arr2;

Reply via email to