Change your default compiler.
Go to C/C++: Edit Configurations (UI)
enter image description here
Change compiler path to whatever you desire. I use gcc-10, so I changed default path to /usr/bin/gcc-10.
Hope it helps.