EEPROMEx library not behaiving as expected

I am trying to implement the EEPROMEx libray and run into a problem.
(http://playground.arduino.cc/Code/EEPROMLoadAndSaveSettings)
In my setup() if want to see if there is a software change:

#include <Streaming.h>
#include <SoftwareSerial.h>
#define SOFTWARE_VERSION "0.1"
const int maxAllowedWrites = 200;
const int memBase = 0;
const int memCeiling = EEPROMSizeATmega328;
boolean OK = true;
int configAdress = 0;

void setup() {
  configAdress  = EEPROM.getAddress(sizeof(StoreStruct)); // Size of config object 
  OK = loadConfig();    // Try to load config
  if(OK) {
           Serial << "Config load" << endl;
           }  // If version are same resume
  else   {
          saveConfig();
          Serial << "Config save" << endl;
          }  // else save defaults and use them

}

And the two routines from that example adjusted to my enviroment:

bool loadConfig() {
  EEPROM.readBlock(configAdress, confValue);
// for debug only
  Serial << SOFTWARE_VERSION << endl;
  Serial << confValue.softwareVersion << endl;
//
  return (confValue.softwareVersion == SOFTWARE_VERSION);
}

void saveConfig() {
   EEPROM.writeBlock(configAdress, confValue);
}

Althoug both version are the same, saveConfig() is called always.

Althoug both version are the same, saveConfig() is called always.

Correctly, too, I’m almost certain.

Where/how is your structure defined?

return (confValue.softwareVersion == SOFTWARE_VERSION);

If softwareVersion in the struct is an array or a pointer, that array address or pointer will never be equal to “0.1”.

You could use strcmp() to see if the two strings are the same. The addresses certainly aren’t.

bool loadConfig() {
  EEPROM.readBlock(configAdress, confValue);
// for debug only
  Serial << SOFTWARE_VERSION << endl;
  Serial << confValue.softwareVersion << endl;
//
  return (confValue.softwareVersion == SOFTWARE_VERSION);
}

Yep, because of this

return (confValue.softwareVersion == SOFTWARE_VERSION);

put this line against the above

return strcmp(confValue.softwareVersion, "0.1")

will solve the issue.

Edit: during typing PaulS already mention that

Ok will try that later. If correct the example is wrong.

If correct the example is wrong.

No. The example is comparing one character at time, not the whole string at once like you are trying to.

Now i am puzzled. The example shows :

void setup() {
OK = loadConfig;
}

void loop() { }

bool loadConfig() {
  EEPROM.readBlock(configAdress, confValue);
  return (confValue.softwareVersion == SOFTWARE_VERSION);
}

So the result of loadConfig() could be false or true but if i understand you correct this isnt so.

The example shows

If the example really shows assigning the address of a function to OK, it is wrong in more that one way.

Ignore it. You know the right way to do what you want.