VSCode debugging

-1

If I run and try to debug program in C in VSCode and get this comment: The program 'C:\vscode\project\build\my_executable.exe' has exited with code 0 (0x00000000). Does it mean that the program run without any problem?

thanks

visual-studio-code
vscode-debugger
asked on Stack Overflow Oct 22, 2020 by may

1 Answer

-1

"Code 0" is the code you pass to the return statement when returning from main (like return 0;), or to exit function (like exit(0);) if your program exits this way. Normally, return code of 0 indeed means that the program successfully finished.

Try returning some other value, like e.g. 123, and you should see VSCode telling you that the program exited with code 123 (0x0000007b). Note though that a non-zero exit code usually means unsuccessful termination (i.e. indicating that an error occurred during execution).

answered on Stack Overflow Oct 22, 2020 by Ruslan • edited Oct 22, 2020 by Ruslan

User contributions licensed under CC BY-SA 3.0