title: How to return a byte[] to C# in C++ CLR
body: <p>I'm using C++ CLR to wrap a native C++ dll. So that the C++ CLR dll can be accessed by a C# project.</p>
  
  <p>The problem is that when I want to return a byte[] to C#, and write such code in CLR:</p>
  
  <pre><code>static System::Byte[]^ GetTestByteBuffer()
  {
      System::Byte[]^ byte = gcnew System::Byte[128];
      return byte;
  }
  </code></pre>
  
  <p>but it cannot pass compilation. Anyone can help me? </p>
  
  <p>compilation error:</p>
  
  <pre><code>error C3409: empty attribute block is not allowed 
  error C3409: empty attribute block is not allowed error C2146: syntax error "^": 
  error C2334: unexpected token(s) preceding '{'; skipping apparent function
  </code></pre>