Hello, i need help to read the content of a string and get it to add it a value. The variable will already be declared.
string mystring;
int minValue;
myString = "minValue";
myString.unknowCommand() = 5;
Serial.print(minValue);
This will print me 5.
Someone know if the "unkowCommand" exist and what is it??
alesam:
toInt() - Arduino Reference
Sorry I forgot the "". I don't want to transfer the char 5 in integer. I want to put 5 to the variable that my string contain in text.
You can't. Variable names cease to exist after the source code is compiled.
gfvalvo:
You can't. Variable names cease to exist after the source code is compiled.
Ho! Thx for that information.
alesam
6
Gadwood:
Sorry I forgot the "". I don't want to transfer the char 5 in integer. I want to put 5 to the variable that my string contain in text.
Convert string to int. Do math. Convert result back to string.