title: Why "pointer=pointer+i" got kind of random value
body: <p>I have some code to read "db_data" (type is std::vector) from database, and to interpret it as array of ipsecSeqTable_t.
  some code piece like below:</p>
  
  <pre><code>typedef struct ipsecSeqTable
  {
      uint64_t seq;
      uint64_t oseq;
      uint32_t spi;
  } ipsecSeqTable_t;
  
  ipsecSeqTable_t* seq_data = reinterpret_cast&lt;ipsecSeqTable_t*&gt;(&amp;db_data[0]);
          uint32_t seq_data_count = db_data.size()/sizeof(ipsecSeqTable_t);
  
          for (uint32_t i=0; i&lt;seq_data_count; i++)
          {
              seq_data = seq_data + i;
              printf("seq_data addr %ld", reinterpret_cast&lt;int64_t&gt;(seq_data ))
              ....
  </code></pre>
  
  <p>This code doesn't work(db_data incorrectly interpreted). With some logging I　found problem is in "seq_data = seq_data + i", I got this print:</p>
  
  <pre><code>seq_data addr 140737018602320
  seq_data addr 140737018602344
  seq_data addr 140737018602392
  seq_data addr 140737018602464
  </code></pre>
  
  <p>sieof(ipsecSeqTable_t) is 24, so I expect the address adds 24*i, so
  the 3rd seq_data addr should be 140737018602368, the 4th should be 140737018602392</p>
  
  <p>If I change seq_data = seq_data + i to below:</p>
  
  <pre><code>ipsecSeqTable_t* temp_seq_data = seq_data + i;
  </code></pre>
  
  <p>I got correct interpretion, and print temp_seq_data gets:</p>
  
  <pre><code>temp_seq_data addr 140737018602320
  temp_seq_data addr 140737018602344
  temp_seq_data addr 140737018602368
  temp_seq_data addr 140737018602492
  </code></pre>
  
  <p>Can some explain why "seq_data = seq_data + i" is wrong?
  Thank you in advance.</p>