Is there any way to set the values in an array after it has been declared?
unsigned char values[16];
// Some other code to decide what to put into the values array
values = {0xAA,0xBB,0xCC,0xDD};
I saw this solution but it is for a C++ implementation. I'm trying to be efficient on memory and avoid a memcpy as well as I don't always need to fill the entire array like in the example above. So far this is the only method that I know works but its very kludgy.
unsigned char values[16];
// Some other code to decide what to put into the values array
values[0] = 0xAA;
values[1] = 0xBB;
values[2] = 0xCC;
values[3] = 0xDD;
memcpy(values, (int[]){0xAA, 0xBB, 0xCC, 0xDD}, 4*sizeof *values);see ideone.com/9ruF7zmemcpy()... not when avoiding it :)unsigned chararray, so amemcpyfrom anintarray won't work.unsigned charas long as you change the type of the unnamed object. Thank you!