You will need to reinstall the C/C++ extension every time you exit VS Code, probably because your extension Settings are not saved. In VS Code, each extension has its own setting options, for example C/C++ extensions can set header path, compiler path, etc. If you don't save these Settings, they will be lost and need to be reset the next time you open VS Code.
Solutions can try the following:
- Make sure you have the latest version of the C/C++ extension installed, as sometimes extension updates fix such problems.
- In VS Code, click the "Extensions" icon on the left, locate the C/C++ extension, click the "Settings" button, and save the Settings you want to save.
- Check your computer for file system errors, as file system errors may cause files to be saved incorrectly. You can check for errors on your disk drive by running the chkdsk command at the command prompt.
- Try using another VS Code extension, such as Visual Studio IntelliCode, if other extensions have the same problem, it may be VS Code and you need to reinstall VS Code.