title: WriteConsoleOutputCharacter in c++ loads of ?s on console
body: <p>So I am following this tutorial here <a href="https://www.youtube.com/watch?v=xW8skO7MFYw" rel="nofollow noreferrer">https://www.youtube.com/watch?v=xW8skO7MFYw</a> and I am new to accessing console buffer and that. I started debugging when I realized my console looked like this <a href="https://ibb.co/896tGGL" rel="nofollow noreferrer">https://ibb.co/896tGGL</a> when I ran it. And I narrowed it down to this line of code</p>
  <pre><code>WriteConsoleOutputCharacter(hConsole, screen, nScreenWidth * nScreenheight, { 0,0 }, &amp;dwBytesWritten);
  </code></pre>
  <p>the values in this are set to:</p>
  <p><code>HANDLE hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);</code></p>
  <p><code>wchar_t* screen = new wchar_t[nScreenWidth * nScreenheight];</code></p>
  <pre><code>int nScreenWidth = 120;
  int nScreenheight = 40;
  </code></pre>
  <p><code>DWORD dwBytesWritten = 0;</code></p>