'I can't see warnings/ runtime errors in VSCODE C++

I used to work in visual studio a lot but for competitive programming I switched to VS-CODE because it is faster and I have special extensions. But I have some problems setting up my environment... I can't see any warning or any runtime error... I searched everywhere, I tried everything and it does not work.. any ideas? Here is a snippet: enter image description here



Solution 1:[1]

Firstly, ensure you have the Microsoft CPP Extension installed, then follow these steps:

You should make sure that you have a problemMatcher in your project tasts.json file

"problemMatcher": "$gcc"

Then you should add this to your settings.json file

 "C_Cpp.errorSquiggles": "Enabled"

And lastly, go to command palette: Ctrl + Shift + P

and search

Run code analysis

Then, open your terminal again (in VSCODE)

and find the Problems tab, and now it should show you what is wrong

Problem tab

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 A Pars