title: C++ How to get the window size (width and height)?
body: <p>I'm trying to create a graph and I need to know the size of the window the user is running the code in. I'm trying to scale the data so the data shows only on the size of the window, without wrapping or scrolling. I'm on windows but I want to use something similar to Linux equivalent</p>
  
  <pre><code>int lines = atoi(getenv("LINES") ;
  int cols  = atoi(getenv("COLUMNS") ;
  </code></pre>
  
  <p>So I can scale numbers and show a graph like this</p>
  
  <pre><code>320 a ============================================================
  160 b ==============================
   80 c ===============
   40 d =======
   20 e ===
   10 f =
    5 g 
    2 h 
    1 i 
    2 j 
   17 k ===
   41 l =======
   67 m ============
   97 n ==================
  127 o ========================
  157 p =============================
  191 q ====================================
  227 r ===========================================
  257 s ================================================
  283 t =====================================================
  331 u ==============================================================
  367 v =====================================================================
  373 w ======================================================================
  379 x ========================================================================
  383 y ========================================================================
  389 z ==========================================================================
  </code></pre>
  
  <p>Is there something that will work on Windows and Linux? I'm using Visual Studio 2012.</p>