How can I concatenate multiple byte Arrays into one Array I have three byte arrays. I first change their values during runtime and after that I want to combine them into one bigger 4th array.

byte a1[] = { 0x01, 0x00, 0x01 };
byte a2[] = { 0x00, 0x11, 0x01 };
byte a3[] = { 0x11, 0x00, 0x01 };

byte c1[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};


I first tried this, but it did not compile.

c1 = a1 + a2 + a3;


I also tried strcat() and I did got a error.
You can concatenate with memcpy. You just need to set the pointer at the right place inside the c1 array.

memcpy(c1, a1, sizeof(a1));
memcpy(c1+sizeof(a1), a2, sizeof(a2));
memcpy(c1+sizeof(a1)+sizeof(a2), a3, sizeof(a3));