I would like to initialise an array with the value set in another array, like:
uint8_t array_1[] = {1, 2, 3};
uint8_t array_2[] = array_1;
Of course this would not work since array_1 is considered a pointer. What I'm trying to do is to be able to statically initialize array_2 with the value of array_1 without using memset.
Since array_1 and array_2 would in my case be constant global buffers, I believe there should be a way to do this, but I haven't figured out how, or by using defines, but I'd rather stick to the other solution if possible.
Thank you
uint8_t* array_2 = array_1;#define INITIAL_VALUES {1, 2, 3}memsetto copy values from one array to another. This is whatmemcpyis for - of course, it is not static initialization.memcpy.