-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

may
  • 29
  • 3

1 Answers1

-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).

Ruslan
  • 15,183
  • 5
  • 55
  • 110