title: how to set default g++?
body: <p>My host has installed c++11 and g++ 4.7.2 (I'm told), but we can't figure out how to set 4.7.2 to default as <code>g++ --version</code> still says I'm 4.1.2.</p>
  
  <p>Stack has shown me that I can't <a href="https://stackoverflow.com/questions/14669533/sort-multidimensional-vector-of-ints?lq=1">sort multidimensional vector of ints?</a> without <a href="https://stackoverflow.com/questions/14674597/cc1plus-error-unrecognized-command-line-option-std-c11-with-g">cc1plus: error: unrecognized command line option &quot;-std=c++11&quot; with g++</a>, but all of the answers I come across for setting the default don't seem to work.</p>
  
  <p><strong>CentOS 5.9</strong></p>
  
  <p>I'm using CentOS 5.9, and I have no idea if that's the issue, but I tried <code>g++-4.7</code> and <code>g++-4.7.2</code> from <a href="https://stackoverflow.com/questions/2916502/how-to-change-version-of-g-compiler-from-4-1-2-to-4-5">How to change version of g++ compiler from 4.1.2 to 4.5?</a>, but SSH says <code>sudo: apt-get: command not found</code> and <code>-bash: g++-4.7: command not found
  </code> for both (<code>.2</code> for .2).  If I put a space before <code>-4.7</code>, it says <code>g++: unrecognized option '-4.7'</code>.</p>
  
  <p>I tried the suggested solution from the A of my last c++ q <a href="https://stackoverflow.com/a/14674646/1382306">here</a>, and the command executes without error, but nothing is returned, and <code>g++ --version</code> still gives:</p>
  
  <pre><code>g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
  Copyright (C) 2006 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  </code></pre>
  
  <p><strong>GCC?</strong></p>
  
  <p>I've seen this associated with g++ on many links, but I don't even know what it is, and I'm afraid to try <a href="https://askubuntu.com/questions/26498/choose-gcc-and-g-version">this</a> for risk of nuking my system.</p>
  
  <p>My host says this is the limit of their support, so I'm totally on my own.  Also, please understand that I just started C++ a week or two ago and have no knowledge of linux.</p>
  
  <p>Please help!  Many thanks in advance!</p>