And I believe the default for passing a struct into a function is pass by reference. So unless I am wrong, that shouldn't be the problem.
It must have something to do with this code.
CubeControl::CubeControl(byte howManyLayers, byte howManyRegisters, byte layerPinNumbers[], byte registerDataPinNums[], byte registerClockPinNums[], byte registerResetPinNums[])
{
//byte data type
numLayers = howManyLayers;
numRegisters = howManyRegisters;
//byte pointers
layerPin = layerPinNumbers;
registerDataPin = registerDataPinNums;
registerClockPin = registerClockPinNums;
registerResetPin = registerResetPinNums;
}
The data types holding all the pin numbers are all pointers. I only call this function once in the Arduino code, but I do create it outside of the loop function. Besides, the pointers only reference the arrays in their original locations. Unless I am missing something.