#Initializing a 3d array efficiently.

9 messages · Page 1 of 1 (latest)

scarlet agate
#

Say I have one char arr[6][3][3] and I want to initialize all elements of arr[n][][] with some particular value for each different n, 0 to 5, of course. How would you do it?
Nested fors are certainly too slow for what I aim to do.
I thought maybe memset? But I'm not sure if the blocks are contiguous.

crimson daggerBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

tame eagle
scarlet agate
#

Thanks a lot.

#

!solved

crimson daggerBOT
#

Thank you and let us know if you have any more questions!

#

[SOLVED] Initializing a 3d array efficiently.

crimson daggerBOT
#

Initializing a 3d array efficiently.