0

[SOLVED] MS Studio Code doesnt take console input

Hi there! Got problems during debugging some C code. Simple-Test.Code: #include <stdio.h> #include <stdlib.h> int main (){ char text[100]; printf("Input: "); gets(text); printf("Output: %s",text); getchar(); return 0; } If i run the executable - everything works fine, but if i want to debugg it in MS Visual Studio Code, nothing happens within the internal terminal. CodeRunner-Extension "run-in-terminal" is checked. Dont know how to fix and debug ...

5th Jul 2022, 3:53 PM
Oliver
4 Answers
+ 1
Already done that. I googled all the time. But finally it works now ... i probably was a typo in one of the jsons. Thx for help!
6th Jul 2022, 4:36 PM
Oliver
+ 1
Make sure that your debugger is configured in launch.json https://gourav.io/blog/setup-vscode-to-run-debug-c-cpp-code https://youtu.be/G9gnSGKYIg4
5th Jul 2022, 6:30 PM
Tibor Santa
Tibor Santa - avatar
+ 1
Ok good. Then check this thread: https://stackoverflow.com/questions/57494832/how-to-read-input-when-debugging-in-c-in-visual-studio-code "if you enable "externalConsole":true in the launch.json then you will get a pop up console window that you can type in."
6th Jul 2022, 4:16 PM
Tibor Santa
Tibor Santa - avatar
0
Already done that. it depends on the input. if i ask for input during the code, nothing happens. if i just print a normal "hello world" everything is fine ...
6th Jul 2022, 3:29 PM
Oliver