2016-04-23 3 views
-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++を忘れてしまいました。誰かが私の記憶をジョギングしてください?

+0

CタグにはC++の質問にタグを付けないでください。 CタグはCの質問のためのものです。 –

+1

_「私はC++を完全に忘れてしまった」_それでは、あなたの教科書を手に入れて、思い出してください。スタックオーバーフローに関する質問には、事前の研究が必要です。 –

答えて

0

このコードは何をしますか?

EERef(のconst int型の指標):コードの特定の行パラメータを受け取り、パラメータ値とEERefindex部材を初期化struct EERefのコンストラクタであることをインデックス(索引){}

参考:Constructors and Initializer Lists

+0

ありがとうJonathon! – nvkris

関連する問題