I've got two arrays, defined as:
uint8_t array1; uint8_t array2;
I'd like to swap the arrays (actually the pointers to each array) using code like this:
uint8_t *tmp = array1; array1 = array2; array2 = tmp;
However, I keep getting errors like:
invalid array assignment
for the last two lines. I don't recall this being such a problem in traditional C++. I've tried all sorts of casting to no avail. Is there something I'm missing?
I can get the code to run properly if I switch the declarations for the arrays to use
new and have them just be more-or-less pointers rather than arrays, but I'd rather not have to do that:
uint8_t *array1 = new uint8_t; uint8_t *array2 = new uint8_t;
Code is running on an ARM-based SAMD51 (Cortex M4 processor).
Thanks for any tips!