MacOS
Arduino IDE2.2.1
Arduino Uno WiFi rev 2
WiFiNINA 1.8.14
Arduino Motor Shield rev 3
for (int i = 0; i < STD_BUFFER_SIZE; ++i) {
if (incomingData1[i].length() > 0) { // Check if the string is not empty
localData1 = atoi(incomingData1[i].c_str());
break; // Stop after converting the first non-empty string
} //if (incomingData1[i].length() > 0)
} //for (int i = 0; i < STD_BUFFER_SIZE; ++i)
I'm using atoi() to change the incoming TCP/IP string to an int. When I run this code as part of a separate sketch, it compiles fine. When I compile the same code as part of a much larger sketch, I get;
error: request for member 'length' in 'incomingData1.arduino::String::operator[](((unsigned int)i))', which is of non-class type 'char'
if (incomingData1[i].length() > 0) { // Check if the string is not empty
Should I be doing the conversion in a different way?