I'm trying to do debugging c/c++ program in vscode debug tab. Well, after setting some properties which is spread through google, it works well. However, when I try to do debug with program containing "scanf" or "cin" which requires user input, it never receives any input from my keyboard. How can I do so?
And what I found from google is that setting "externalConsole" value as true like this picture.
{
"version": "0.2.0",
"configurations": [
{
"name": "g++ - 활성 파일 빌드 및 디버그",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Sort/test",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"preLaunchTask": "C/C++: g++ build active file"
}
]
}
However, if I change the value of externalConsole as true and try to debug program containing cin, there is no progress after the below picture.
the moment tryting to debug the given program
Even though I try to input the data in the external console(for example "asd"), it says "zsh:command not found asd". How can I fix it for program to receive my input. HELP ME PLZ
1 Answer 1
- install CodeRunner extension on your VSCode
- and then follow steps :
Code -> Preferences -> Settings - then on setting type CodeRunner Settings
- find the Run In Terminal
- Enable that function
Follow these steps and you will be able to run your code on VSCode terminal and it would be possible to enter Input