user47644: I'm trying to make a programm for Arduino Bluno Beetle, that saves a string in the loop. Here is my code:
#include <EEPROM.h>
#include <EEPROMAnything.h>
struct config_t{
   String lastThing;
    } savedValues;
void setup(){
   EEPROM_readAnything(ADDR, savedValues);
   Serial.println(lastThing);
}
String readString="asd";
void loop() {
 //...
 lastThing=readString;
 EEPROM_writeAnything(ADDR, savedValues);
}

(The EEPROMAnything.h can be found here: https://playground.arduino.cc/Code/EEPROMWriteAnything?action=sourceblock&num=1)
The code works until the 11th line. It gives there the following error:
'lastThing' was not declared in this scope

Does anybody know how to fix this problem?

user313: The proper syntax for referring to a struct member is [structName].[memberName]. Changing lastThing in lines 8 & 13 to savedValues.lastThing fixes the "undeclared" error.

47644: <p>I'm trying to make a programm for Arduino Bluno Beetle, that saves a string in the loop. Here is my code:</p>

<pre><code>#include &lt;EEPROM.h&gt;
#include &lt;EEPROMAnything.h&gt;
struct config_t{
   String lastThing;
    } savedValues;
void setup(){
   EEPROM_readAnything(ADDR, savedValues);
   Serial.println(lastThing);
}
String readString="asd";
void loop() {
 //...
 lastThing=readString;
 EEPROM_writeAnything(ADDR, savedValues);
}
</code></pre>

<p>(The EEPROMAnything.h can be found here: <a href="https://playground.arduino.cc/Code/EEPROMWriteAnything?action=sourceblock&amp;num=1" rel="nofollow noreferrer">https://playground.arduino.cc/Code/EEPROMWriteAnything?action=sourceblock&amp;num=1</a>)</p>

<p>The code works until the 11th line. It gives there the following error:</p>

<pre><code>'lastThing' was not declared in this scope
</code></pre>

<p>Does anybody know how to fix this problem?</p>
 313: <p>The proper syntax for referring to a struct member is [structName].[memberName]. Changing <code>lastThing</code> in lines 8 &amp; 13 to <code>savedValues.lastThing</code> fixes the "undeclared" error.</p>
