title: Returning a wchar_t in C++
body: <p>I'm making a function that return a pointer to a wchar_t, but it returns nothing each time I use it.</p>
  
  <p>Function:</p>
  
  <pre><code>wchar_t *Character::getCharHealth() {
      wchar_t charHealth[256];
      swprintf_s(charHealth, L"%d", this-&gt;getHealth());
      wprintf(L"%s\n", charHealth);
      wchar_t* cHealth = charHealth;
      return cHealth;
  }
  </code></pre>
  
  <p>The getHealth() function:</p>
  
  <pre><code>int Character::getHealth() {
      return this-&gt;health;
  }
  </code></pre>
  
  <p>Where it is used:</p>
  
  <pre><code>spriteFont-&gt;DrawString(spriteBatch.get(), warrior-&gt;getCharHealth(), DirectX::SimpleMath::Vector2(40, 0));
  </code></pre>
  
  <p>Is there anything wrong with my code?</p>