New answers tagged

0

You define pointers for each value as : char *matrix[numChars]; //matrix of data entries However, in all cases you let it point to data: matrix[i]=data; Than you set the value starting from that address. So what happens is after you read the first value (11), and matrix[0] contains '11', than matrix[1] points to the same data which you write the value ...


0

you can try something like this int first_space = request.indexOf(' '); // location of the first space int second_space = request.indexOf(' ', first_space); // the next space after first String query_arg = request.substring(first_space,second_space);


0

One possible solution is: Serial.println((String)"Var 1:" + var1 + " Var 2:" + var2 + " Var 3:" + var3);


4

The return value of strcmp does not have boolean semantics, as you seem to incorrectly assume. strcmp is a tri-state comparator, which returns negative, zero or positive value. For equal strings it returns zero, which means that an equality comparison with strcmp should normally look as follows if (strcmp(str1, str2) == 0) Serial.println("Equals"); else ...


0

There is another string compare function that may work for you strncmp() void setup(){ Serial.begin(9600); char str1[64] = "test with spaces"; char str2[32] = "test with spaces"; if(strncmp(str1, str2, 64) == 0){ Serial.println("strings match"); } else{ Serial.println("strings do not match"); } } void loop(){}


Top 50 recent answers are included