title: C++ code showing error sometimes in VS Code sometimes and not others
body: <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int main() 
  {
      cout &lt;&lt; &quot;Welcome to this video&quot;&lt;&lt;&quot;\n&quot;;
  
      int a;
      a = 10;
  
      switch (a) {
          default:
          cout &lt;&lt; &quot;default is executed whatever happens&quot;;  
          case 10:
          cout &lt;&lt; &quot;a is 10&quot; &lt;&lt; &quot;\n&quot;;
          case 5:
          cout &lt;&lt; &quot;a is now 5&quot; &lt;&lt; &quot;\n&quot;;
      }
      return 0;
  }
  </code></pre>
  <p>This is my code. When I am trying to comment line:</p>
  <pre><code>default:
  cout &lt;&lt; &quot;default is executed whatever happens&quot;; 
  </code></pre>
  <p>and then when I am saving and running the code I am getting the error</p>
  <pre><code>C:/Program Files/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  <p>But when I am closing and opening my terminal 2-3 times and then running the code, my code is working fine after 2-3 attempts. Similarly when I am uncommenting the commented code and when I am trying to run it I am getting error:</p>
  <pre><code>tempCodeRunnerFile.cpp:1:7: error: expected unqualified-id before 'default'
         default:
  </code></pre>
  <p>Can anyone please tell me why C++ is working like this. I am using VS code as my code editor and my GCC version is 8.1.0.</p>