I'm currently trying to debug a C++ code using VSCode. I have been able to successfully debug Python code many times by putting in my inputs and then debugging the code, but for some reason C++ does not let me debug my code in the built in terminal. The error message looks like this:
The Message I'm getting in Terminal - Image
I've looked at a lot of different Stack overflow posts, but none of them seem to work. Here are some things I've tried:
- In my launch.json, I tried making "externalConsole": true, but this doesn't seem to fix anything. I have included a picture of my launch.json as well.
- In my tasks.json, I tried adding an "Open Terminal" line which I got online, but this doesn't seem to work.
- I added "code-runner.runInTerminal": true, to my settings.json, but this doesn't seem to work.
- I've also included my configurations
Picture of Cpp_properties.json
Right now, I'm just clicking on the little "debug" button at the top and then clicking on "Debug C/C++ Code", but this doesn't seem to work. I've tried downloading other extensions to run my code that way but that also doesn't work.
I'm using MacOS, and I think I'm using Clang as my C++ compiler, though I'm not too sure about this.
Whenever I try doing something basic as like running the code (e.g. cout << "Hello World"), this works, but for some reason the cin code doesn't work? Like I'm not able to give my code ANY input. I need to be able to give my code input for USACO...