How to write a string in eeprom ?

You can write any NUL-terminated string into EEPROM with one function call:

#include <avr/eeprom.h>

eeprom_write_block((void *)mystr,(void *)ee_addr,strlen(mystr));

where 'mystr' is a pointer to the NUL-terminated string, and 'ee_addr' is the starting address in EEPROM. This will work for constant strings or char or byte arrays.

For documentation on this and related functions, see avr-libc: <avr/eeprom.h>: EEPROM handling

Regards,

-Mike