I keep getting weird errors trying to parse data from publishs.
heres the boron code:
void mainHandler(const char *event, const char *data) {
int restart;
char cmd[40];
sscanf(data, "%i;%i;%i;%i;%i;%i;%i;%[^;]s;", &red, &green, &blue, &flashit, &buzzit, &stateSystem, &restart, &cmd);
Here’s the error. Now I’ve tried char cmd;
and char *cmd
and char* cmd
and it constantly gives me errors. What is going on, I’m just needing the string out of this sscanf.
c:/test/test13/src/test3.ino:367:15: warning: format ‘%[^;’ expects argument of type ‘char*’, but argument 10 has type 'char ()[40]’ [-Wformat=]
367 | sscanf(data, “%i;%i;%i;%i;%i;%i;%i;%[^;]s;”, &red, &green, &blue, &flashit, &buzzit, &stateSystem, &restart, &cmd);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
| |
| char ()[40]