Question for EEPROM_readAnything/EEPROM_writeAnything.

I am getting somewhere...

I have noticed that if you pass a variable by reference to a function and assign 0xFF to its bytes hapens exactly the same. After programing eeprom is 0xFF.

If I zero out the bytes I use for storing everithing looks fine.

void setup() {
  int i;
//using the first byte as an indicator for the first run after programming.
  if (EEPROM.read(0) == 0xff) {
  EEPROM.write(0,0x00);
  for (i=0; i<20; i++) {  //i could be up to 512
    EEPROM.write(i,0x00);
  }
  }
  
  read_c();
  Serial.begin(9600);
  pinMode(sw_0, INPUT);
}
  }