vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

input didn't taken by compiler in c++

Open Ritesh-FSD opened this issue 2 years ago • 4 comments

I get an issue in getting a input from the user. example - int main() { int a; cout<"enter a number :"<<endl; cin>>a; return 0; } output 👎 enter a number :
//but here what the problem is compiler didn't allow to input a number.

for your reference my extension are:

  1. code runner
  2. c/c++
  3. g++

please solve this issue asap.

Ritesh-FSD avatar Sep 27 '21 17:09 Ritesh-FSD

vs problem

Ritesh-FSD avatar Sep 27 '21 17:09 Ritesh-FSD

you could add a code runner configuration in "settings -> extension -> Run Code configuration" , and you can check if your Run In Terminal configuration is checked.

yantul avatar Sep 28 '21 02:09 yantul

you could add a code runner configuration in "settings -> extension -> Run Code configuration" , and you can check if your Run In Terminal configuration is checked. @yantul

Adding to this, the default output panel does not allow input. So either you give input from a file, or change the said setting. In your setting.json file, add "code-runner.runInTerminal": true,, or you can do as he said.

lokesh-kurre avatar Dec 15 '21 19:12 lokesh-kurre

you could add a code runner configuration in "settings -> extension -> Run Code configuration" , and you can check if your Run In Terminal configuration is checked.

A lot of c++ users (including me) has this confusion at first, maybe we can set the option of running in terminal as default to true? :-)

fei4xu avatar Dec 27 '21 03:12 fei4xu