about writing and reading string in external at24c1024 eeprom library

i am working on a certain project in which i have to do datalogging using external eepromat24c1024. so i am using that at24c1024 eeprom library. my question is can i read/write a string using eeprom1024 write and read? cause it is showing me an error of &string is not in .write class.

When you write to Eeprom, you must use fixed length data items. The nearest to a String (Arduino String object) would be a fixed length character array e.g. char[50]. There are other alternatives. Post your code for more opinions.

so i am using that at24c1024 eeprom library.

my question is can i read/write a string using eeprom1024 write and read? cause it is showing me an error of &string is not in .write class.

Please provide a link to the library you are using. The jwhiddon library does not support block writes and you will need to use single byte writes. With the single byte write approach, there is no need to consider page boundaries and it keeps the library simple.

You can not save a String object to eeprom, but you can save character arrays.

You may want to consider using Jack Christensens external eeprom library which does support block writes and deals with the page boundary issue.

And beware the "String" class in general with Arduinox. It causes mysterious program crashes after time (due to garbage collection limitations).

cattledog:
Please provide a link to the library you are using. The jwhiddon library does not support block writes and you will need to use single byte writes. With the single byte write approach, there is no need to consider page boundaries and it keeps the library simple.

You can not save a String object to eeprom, but you can save character arrays.

You may want to consider using Jack Christensens external eeprom library which does support block writes and deals with the page boundary issue.
GitHub - JChristensen/extEEPROM: Arduino library to support external I2C EEPROMs.

this library i have used

I knew there just had to be libraries out there.
A few weeks ago I needed an external EEPROM for a project, picked the 24HC256, couldn't find a library, so wrote my own - mimicking the interface of the built-in EEPROM library. A fun exercise. Taking page boundaries into account.
It should be able to write String objects just fine, like the EEPROM library it is written to handle any object thrown at it. Reading back the String object won't work as the function relies on the size of the object passed, and that is variable with a String.

Best option: create a char array the length of the String, then write that to EEPROM. If the length is variable, use 1-2 bytes first to write the length of your string, after that the string itself.

To read back, read the length, create an object that length, then read back the bytes.