I'm not really sure what the correct way to initialize a 3d array is.
float array3D[100][100][100] = {0};
Is this correct? When I try to compile I get problems.
Jump to Postyour code isn't wrong but the size of the array is too big. Your are creating a 100*100*100 sized array. if you try with a slower array it will work.
I think this is correct however, I am trying to create an array of size 1000x1000x1000. When I try to initialize an array of this size I get an error saying that an array must not exceed a certain size. Is there a way around this?
your code isn't wrong but the size of the array is too big. Your are creating a 100*100*100 sized array. if you try with a slower array it will work.
> Is there a way around this?
Yes, get a 64-bit processor with at least 8GB of memory, and an OS/Compiler that can actually take advantage of all that hardware.
Or you figure out how to factorise your problem into say 8 iterations with 500x500x500 blocks (assuming that will fit - it's still 0.5GB).
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.
You're trying to visit a URL that doesn't currently exist on the web. Most likely, a member posted a link a long time ago to a web page that has since been removed. It's also possible that there was a typo when posting the URL. We redirect you to this notice instead of stripping out the link to preserve the integrity of the post.