title: WriteConsoleOutputCharacterW - Where are my new lines?
body: <p>I'm trying to learn how to use a screen buffer, and I made a mistake that I do not understand. These are the settings for my screen buffer:</p>
  
  <pre><code>wchar_t* screen = new wchar_t[nScreenWidth * nScreenHeight];
  for (int i = 0; i &lt; nScreenWidth * nScreenHeight; i++) {
      screen[i] = L' ';
  }
  
  HANDLE hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
  SetConsoleActiveScreenBuffer(hConsole);
  DWORD dwBytesWritten = 0;
  
  WriteConsoleOutputCharacterW(hConsole, screen, (nScreenWidth * nScreenHeight), { 0,0 }, &amp;dwBytesWritten);
  </code></pre>
  
  <p>I manage to print to it my 2D array but it is weird that it's lying flat in my terminal window (see link to print screen).</p>
  
  <p><a href="https://i.stack.imgur.com/M1QQ3.png" rel="nofollow noreferrer">Small print screen of my failed 2D array</a></p>
  
  <p>It's as if all the new lines have been removed. This is my loop that prints my 2D array to "screen".</p>
  
  <pre><code>int g = 0;
  
  while (g &lt; 100) {
      WriteConsoleOutputCharacterW(hConsole, screen, (nScreenWidth * nScreenHeight), { 0,0 }, &amp;dwBytesWritten);
  
      for (int i = 0; i &lt; field.difficulty; i++) {
          std::this_thread::sleep_for(std::chrono::milliseconds(50));
  
      }
  
      for (int y = 0; y &lt; field.nFieldHeight; y++) {
          for (int x = 0; x &lt; field.nFieldWidth; x++) {
  
              screen[(y + 2) * field.nFieldWidth + (x + 2)] = field.matrix[x][y];
          }
  
      }
  }
  </code></pre>
  
  <p>Is it possible that I need to write to a coordinate in the screen buffer every time I print a character?</p>