Something like 6 months ago I made a class that encapsulated an array of any number of dimensions using cstdarg, but I never finished it because I couldn't figure out how to keep the old data. Sometime today someone asked about variable dimension arrays, which perked up my interest again. While fixing the code, I figured out how to keep the old data, but I couldn't figure out how to implement it... I would have to use memcpy for every dimension except x with every possible index. For example, an array like this:
1 2 5 6
3 4 7 8
When adding a 4th dimension, would need to copy the positions (0,0,0), (0,1,0), (0,0,1), and (0,1,1) to keep those values. How would I do this?
Almost forgot, the code vvv
http://pastebin.com/LXCruUNi