I've got a function which expects a variable and a pointer.
void sendCMD(byte cmd, byte data[]){
...
}
Is it possible to call this function with the data in anyway like so
sendCMD(0xff, { 0x0a, 0x02 });
Since even by googleing I didn't find anything... maybe I haven't looked hard enough, but I'm also not exactly sure what the terms are I should be looking for.
Any help is kindly appreciated!
Note that byte
is the same thing as a char
!
You can use a compound array literal:
sendCMD(0xff, (byte[]){ 0x0a, 0x02 });