EEPROM.put() - how to know how much memory was used?

Hello, I didn't find a clear answer to my doubt:
after executing EEPROM.put( startAddress, myStruct ) is there any "easy" way to know the address of the last byte occupied by the struct itself?

I would write a couple of arrays just after the stored struct but... I don't know where it ends! Obviously I could calculate it by myself but I wonder why the put() function does not return just the number of byte used.

p.s.
As I know the sizeof operator is not always working 'cause of packing/padding actions of the compiler.

sizeof(myStruct)

As I know the sizeof operator is not always working 'cause of packing/padding actions of the compiler.

Have you looked at the source code? The EEPROMClass struct (who the fuck decided that a struct should have class in the name?) contains the put() method. It uses sizeof() to determine the number of bytes to write.

PaulS:
Have you looked at the source code? The EEPROMClass struct (who the fuck decided that a struct should have class in the name?) contains the put() method. It uses sizeof() to determine the number of bytes to write.

:o

Ok, thanks to both of you. I will go with sizeof to know how many EEPROM bytes was used. :wink:

Alternatively, could I make my struct larger and include my additional two array in it?

I'm using IDE 1.6.5 so the EEPROM.put()/get() function should be able to manage struct with "mixed" contents, I'm right?

I mean a struct like this:

struct {
 byte param1;
 int param2;
 byte array1[10];
 int array2[10];
} parameters;

EEPROM.put(0, parameters);

This should work too... or not?

This should work too

Yes.