I would like to start a.exe (a compiled cpp program) with a file passed into it. On the CMD I would do it like a.exe < input.txt
. How can start it with VS Code in debug mode?
This is my launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/a.exe",
"args": [
"<",
"input.txt"
],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "lldb"
},
"windows": {
"MIMode": "gdb"
}
}
]}
As args
I already tried to to use "<", "input.txt"
as like in this post and "<input.txt"
as suggested in this post. Both do not work. Debugging on the cmd, as suggested here seems like a very bad practice. Why should I debug on a cmd, when I have the awesome debug tools of vs code?
I run on a windows machine.