title: i2c byte write function, how works this code? I can´t understand complety
body: <p>Can someone explain me how works this lines</p>
  
  <pre><code>template &lt;class T&gt;
  ...const T&amp; value)...
  .
  .
  . 
  const uint8_t* p = (const uint8_t*)(const void*)&amp;value;
  </code></pre>
  
  <p>on this code (i2c byte write for eeprom)</p>
  
  <pre><code>template &lt;class T&gt;
  uint16_t writeObjectSimple(uint8_t i2cAddr, uint16_t addr, const T&amp; value){
  
        const uint8_t* p = (const uint8_t*)(const void*)&amp;value;    
        uint16_t i;
        for (i = 0; i &lt; sizeof(value); i++){
              Wire.beginTransmission(i2cAddr);
                    Wire.write((uint16_t)(addr &gt;&gt; 8));  // MSB
                    Wire.write((uint16_t)(addr &amp; 0xFF));// LSB
                    Wire.write(*p++);
              Wire.endTransmission();
              addr++;
              delay(5);  //max time for writing in 24LC256
        }
        return i;
  }
  
  template &lt;class T&gt;
  uint16_t readObjectSimple(uint8_t i2cAddr, uint16_t addr, T&amp; value){
  
              uint8_t* p = (uint8_t*)(void*)&amp;value;
              uint8_t objSize = sizeof(value);
              uint16_t i;      
              for (i = 0; i &lt; objSize; i++){
                    Wire.beginTransmission (i2cAddr);
                          Wire.write((uint16_t)(addr &gt;&gt; 8));  // MSB
                          Wire.write((uint16_t)(addr &amp; 0xFF));// LSB
                    Wire.endTransmission();
                    Wire.requestFrom(i2cAddr, (uint8_t)1);         
                    if(Wire.available()){
                          *p++ = Wire.read();
                    }
                    addr++;
              }
              return i;
  }
  </code></pre>
  
  <p>I think the lines works like pointers?
  I can't understand how the code store correctly each type of data when I do that</p>
  
  <pre><code>struct data{
      uint16_t yr;
      uint8_t mont;
      uint8_t dy;
      uint8_t hr;
      uint8_t mn;
      uint8_t ss; 
  };
  .
  .
  .
  data myString;
  writeObjectSimple(0x50,0,myString);
  </code></pre>
  
  <p>And then recover the values correctly using</p>
  
  <pre><code>data myStringRead;
  readObjectSimple(0x50,0,myStringRead)
  </code></pre>
  
  <p>the function i2c byte write detect some special character between each data type to store in the correct place?</p>
  
  <p>thx</p>