0

I'm trying to debug c++ code in vs-code and needs to pass argument to start debugging. to run the program in command line its just like that:

[user@localhost ~]$ ./hello-world 10

how to configure input parameter when debugging? thanks for help in advance.

Sreemat
  • 616
  • 10
  • 28
mehrdadataee
  • 1
  • 1
  • 1
  • 1
    For better debugging purpose i suggest to use an IDE rather than Editor. – Ghasem Ramezani Dec 28 '20 at 14:40
  • The file you need to edit is `launch.json` related: [https://code.visualstudio.com/docs/cpp/launch-json-reference#_environment](https://code.visualstudio.com/docs/cpp/launch-json-reference#_environment) and [https://stackoverflow.com/questions/46340968/specifying-arguments-in-launch-json-for-python](https://stackoverflow.com/questions/46340968/specifying-arguments-in-launch-json-for-python) – drescherjm Dec 28 '20 at 14:43

1 Answers1

0

You can run it like that :

devenv /debugexe 'program name' 'program arguments'

Or use your IDE and define your arguments , all what you need is here =>

Debugging with command-line parameters in Visual Studio

Zz Oussama
  • 229
  • 1
  • 12