vscode-code-runner
vscode-code-runner copied to clipboard
input didn't taken by compiler in c++
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:
- code runner
- c/c++
- g++
please solve this issue asap.
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.
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.
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
? :-)