-1
這段代碼做了什麼?Arduino EEProm.h代碼
EERef(const int index)
: index(index) {}
這是一個結構裏面像這樣...
/***
EERef class.
This object references an EEPROM cell.
Its purpose is to mimic a typical byte of RAM, however its storage is the EEPROM.
This class has an overhead of two bytes, similar to storing a pointer to an EEPROM cell.
***/
struct EERef{
EERef(const int index)
: index(index) {}
//Access/read members.
uint8_t operator*() const
{
return eeprom_read_byte((uint8_t*) index);
}
operator const uint8_t() const
{
return **this;
}
.....等等....
我已經完全忘記了我的C++。有人請記住我的記憶?
請不要使用C標籤標記C++問題。 C標籤用於C語言問題。 –
_「我完全忘記了我的C++。」然後拿起你的教科書並提醒你自己。有關Stack Overflow的問題需要事先研究。 –