C++ memory alignment <p>So I read that when variables are declared in c++ if you want to get the optimum cache reads the memory should stick to its natural alignment. Example:</p> <pre><code>int a; // memory address should end in 0x0,0x4,0x8,0xC int b[2]; // 8 bytes 0x0,0x8 int b[4]; // 16 bytes 0x0 </code></pre> <p>But in practice these variables do not follow the "natural alignment" rules, a 16 byte variable was residing at a memory address that ended in 0xC. Why is this ?</p>