title: Can I specify an integer constant by its bytes?
body: <p>I'm using C++11 on a project of mine and was wondering how best to represent the ELF magic number. I'm not a fan of hex literals, so I was looking for something better than:</p>
  
  <pre><code>const uint32 ELF_MAGIC_NUMBER = 0x7F454c46; // 0x7F, E, L, F
  </code></pre>
  
  <p>So, I tried to write:</p>
  
  <pre><code>const uint32 ELF_MAGIC_NUMBER = { 0x7F, 'E', 'L', 'F' };
  </code></pre>
  
  <p>but the compiler complains that there are too many items in the initializer list, which is understandable, although annoying.</p>
  
  <p>Is there any way to write an integer literal in terms of its bytes? I feel like the first option, while it works, is not as readable at the second.</p>