Debug Your Code with VScode on Ubuntu

 Debug Your Code with VScode on Ubuntu

1. click the fourth button shaped as a triangle and you will see the launch.json file located in the .vscode document in your source projection.

Debug Your Code with VScode on Ubuntu2. This is one of my .json file. You can see that I only changed two parts of it. The first one is "program", behind it you have to give the executive file including its location and the file name, in order to avoid errors caused by the relative path, so I give the absolute path of the executive file, you can use pwd command to obtain the absolute path of your executive file. The second parameter that I need to edit is "args", if you have to give some arguments at the same time, you have to specify them here. Remember that write all your arguments within the square brackets([ ]) and auguments should be sperated by commas, and don't forget each one with a pair of double quotes(" ") because they are strings.

3. If you have finished above works, and you're sure you have build your projection successfully, now, you can click the green triangle shape button in the picture one, then if everything is okey, a terminal will come out and your project starts to work.