How do I take inputs in from terminal directly on VSCode using Clang C++ Debugger?

Viewed 20

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:

  1. 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.

Picture of my Launch.json

  1. In my tasks.json, I tried adding an "Open Terminal" line which I got online, but this doesn't seem to work.

Picture of my Tasks.json

  1. I added "code-runner.runInTerminal": true, to my settings.json, but this doesn't seem to work.

Picture of my Settings.json

  1. 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...

0 Answers
Related