How do I read flash memory in my Arduino Nano?

I would like, at least, to be able to identify what version of code is in my microprocessor. How can I do this?

What version of your own code?

What I meant by my question is: How can I write into flash memory in real time and read what I wrote the next time I connect to my PC based Arduino0022 compiler?

You probably write with the tool AVRDUDE.exe (hold the shift key when uploading code and you see the tools used.

AVRDUDE can read back hex files but it is up to you to extract a version from this binary file .

A way that seems to work is something like (IIRC)

volatile char s[] = "VER1.00"; // by using volatile the compiler does not optimize the string away.

void setup() { etc

Another option would be to set the version number in EEPROM and read that with AVRDUDE

my 2 cents,