If your main() throws an uncaught C++ exception, the CRT catches it, calls terminate() , and then ExitProcess(3) . The code 3 means nothing about your logic—it simply signals "CRT abnormal termination."
This layering leads to a key insight: . The default for a thread is STATUS_THREAD_TERMINATED (0x00000100); for a process, it is STATUS_PENDING (0x00000103) until termination, then the final code. 2. The Semantic Wasteland: What Does Non-Zero Mean? Unlike Unix, where exit codes are small (0–255) and often mapped to sysexits.h conventions, Windows exit codes are full 32-bit values, blending several distinct categories: exit codes windows
> err 0xC0000005 # for hex 0xc0000005 / decimal -1073741819 STATUS_ACCESS_VIOLATION Check against Win32 error codes: If your main() throws an uncaught C++ exception,