That's because sizeof doesn't care about the value. It only looks at the type and gives you the size in bytes for that type in your implementation. So for your system, an unsigned int uses 4 bytes...