Arduino can store only char variables in the EEPROM.
Here, a pointer of the type char is created. This pointer is then assigned to the address of our any variable.
So that the compiler does not bother, because of different type of pointer and variable I use the "reinterpret_cast < c h a r *>". With "reinterpret_cast" each type is considered char.
With the "&" sign in front of the variable names, it is possible to determine the start address of the variable in the RAM.
Now EEPROMAnythingWrite function can store all bytes of any variable in the EEPROM one after the other.
For the EEPROMAnythingWrite function to know how many bytes to store, the number of bytes in the variable is passed with "sizeof (variable)" to the function.
The EEPROMAnythingWrite function returns the next free memory location in the EEPROM as a return value.



webmaster_x_esp8266-server.de