I do not know what an Int is so I cannot convert to it.
Perhaps I can convert to an int, but in one place there is a request to convert a string to an int, and in another place there is a request to convert a String to an int.
These are different types, and since only a snippet of the program was provided, I am left to guess that str1 is a buffer for a string, not a String.
itoa(...) or snprintf(...) would work.
By the way, I quickly found this by using Bing; Google would have worked just as well.
Of course, the string in str1 must be properly terminated with a 0. I do not know if readStringUntil(...) does this or not. And of course, I do not understand the point of repeatedly getting a string, repeatedly converting to an int, and then throwing everything away except the last int.
Hi,
I am converting a number to character by adding 30 and then to string to be display but need the value as integer back for other calculations,
var1 & var2 = digit
bcd_strm = String( char(var1+0x30))+String(char(var2+0x30)) ;
bcd_dec = atoi(bcd_strm.c_str());
It worked for me. I do not know if this is what he looking for.