Difference between Run Code and Run without Debugging in VS Code

Viewed 11103

I am a newbie in cpp programming and use visual studio code, I don't understand what is the difference between Ctrl + Alt + N(To run code) and Ctrl + F5(Run without Debugging).

enter image description here

enter image description here

2 Answers

Ctrl + Alt + N (Run Code) is a shortcut provided by the "Code Runner" extension you installed while Ctrl + F5 (Run Without Debugging) is a shortcut provided by VS Code by default. Both shortcuts run the code without debugging and they have the same function.

CTRL-F5 is just F5

It's probably worth noting since this is tagged c++ that CTRL-F5, run without debugging actually runs with debugging as of August 23rd 2021. That's in-spec for the app according to these docs, "Tip: The Run action is always available, but not all debugger extensions support 'Run'. In this case, 'Run' will be the same as 'Debug'."

SHIFT-F5 is no Panacea

SHIFT-F5 from the standard C++ extension, by contrast, does run without debugging, but runs a target set by its own mechanism, not the current launch configuration used by F5 and CTRL-F5. Since it bypasses the launch.json launch configurations, it does not let you change the location of the current working directory for your app or pass-in command line arguments to it.

Related