Reputation: 53
I want to know where to put command line arguments in VS Code for C. I know in Visual studio you can hit the project and add the command line arguments, but I do not know how to do that in VS Code.
Upvotes: 4
Views: 22755
Reputation: 139
{
"name": "C Launch",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": ["arg1", "arg2"],
"cwd": "${workspaceFolder}"
}
put the above line in the .vscode/launch.json
file in your working directory. Be sure to replace a.out
with your name of program.
For further details check here.
Upvotes: 8