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 ...
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!
+ 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
+ 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."
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 ...