title: Why does GetComputerNameEx return a string with a strange encoding?
body: <p>I'm trying to make a function that returns the name of the computer. This is what I have so far:</p>
  
  <pre><code>char* getName()
  {
      char buffer[MAX_COMPUTERNAME_LENGTH + 1];
      DWORD length = sizeof(buffer);
  
      GetComputerNameEx((COMPUTER_NAME_FORMAT)0, buffer, &amp;length);
  
      return buffer;
  }
  </code></pre>
  
  <p>But it doesn't really work. It seems it returns a string with very strange character encoding. I would appreciate all help.</p>