title: Compiling C++11 in Visual Studio Code
body: <p>I'm using Visual Studio Code to compile C++ programs and it works for most C++ programs as it compiles it using <code>g++</code> command. However, I am facing difficulty in compiling <code>c++11</code> programs using it.</p>
  
  <p>When I try compiling C++11 programs, the compiler command <code>g++</code> tries to compile it using default C++98 Standard and this results in errors.</p>
  
  <p>I am aware that using <code>g++ -std=c++11</code>, we can compile C++11 programs using <code>g++</code> and it works fine when I use it in my <code>cmd</code> as:</p>
  
  <blockquote>
    <p>g++ -std=c++11 some_program.cpp</p>
  </blockquote>
  
  <p>I wish I could tweak some setting in Visual Studio Code and change the compiler command from <code>g++</code> to <code>g++ -std=c++11</code> so that I could compile programs by just hitting the <code>run code</code> button. However, I'm not able to find one. Please help me out if there are alternate ways to get my program compiled.</p>
  
  <p>Currently, I'm getting errors as:</p>
  
  <blockquote>
    <p>some_program.cpp: In function 'int main()':</p>
    
    <p>some_program.cpp:12:33: error: in C++98 'A' must be initialized by constructor, not by '{...}'
    vector A = { 11,2,3,14 };</p>
  </blockquote>
  
  <p>The snippets are correct and have been tested with online compilers using C++11. Here, it is trying to compile using <code>C++98</code> as seen in the error.</p>