c - How do you convert binary argv to string? -
c - How do you convert binary argv to string? -
i have c function:
void sysexcallback(byte command, byte argc, byte *argv) { ... }
and want convert argv[0]
(binary) simple string. tried things like:
char v[10]; strcpy(v,argv[0]);
but gives me error:
arduino/hardware/tools/avr/avr/include/string.h:126:14: error: initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive]
strcpy takes 2 character pointers parameters. argv[0] byte, not char pointer. seek
strcpy(v,(char *)argv);
alternatively can create character pointer , point byte pointer so:
char *string = (char *)argv;
c arduino
Comments
Post a Comment