title: 'variable': initialized auto or register variable not allowed at function scope in 'naked' function
body: <pre><code>int __declspec(naked) Testing(int _byte, int _byte_size) {
  
      int byte_size = _byte_size;
      BYTE* bytec = new BYTE[byte_size];
      memcpy(reinterpret_cast&lt;void*&gt;(bytec),
             reinterpret_cast&lt;void*&gt;(_byte), byte_size);
  
      int RE_format = 0;
   }
  </code></pre>
  
  <p>This is whats cause the error, How would I go about fixing this? I have other code that I don't want to disclose but these are the main variables that are causing the error C2489.</p>