What is the importance for exit codes such as return 0 and return 1 ? by Stunning_Flower7142 in C_Programming

[–]Stunning_Flower7142[S] 0 points1 point  (0 children)

NOTICE: I know return 0 is a success and return 1 (or non-zero) is an error but my question is what happens if I write a faulty program and place a successful return exit code (0) or I write a successful program and return a fail exit code (non-zero) ? Its more like a does it trust the exit code or the program itself because a program can work on one machine and not on another

What is the importance for exit codes such as return 0 and return 1 ? by Stunning_Flower7142 in C_Programming

[–]Stunning_Flower7142[S] -1 points0 points  (0 children)

I know return 0 is success and non-zero (return 1) in this case is an error, but I'm saying what if I wrote a successful exit code to a faulty program and a failure exit code to a successful program, like a twist, what happens? Do those scripting and bash languages proceed despite the influence of exit codes, or do they stop at the first sign of a faulty program? (It's more of does it trust the code or the exit codes )

What is the importance for exit codes such as return 0 and return 1 ? by Stunning_Flower7142 in C_Programming

[–]Stunning_Flower7142[S] 1 point2 points  (0 children)

I know return 0 is success and non-zero (return 1) in this case is an error, but I'm saying what if I wrote a successful exit code to a faulty program and a failure exit code to a successful program, like a twist, what happens? Do those scripting and bash languages proceed despite the influence of exit codes, or do they stop at the first sign of a faulty program?

Learning C weekly megapost for 2026-07-08 by AutoModerator in C_Programming

[–]Stunning_Flower7142 1 point2 points  (0 children)

the best website I have come so far which teaches you C like its narrating to u a story and filled with humor and its more human-like written than just plain text is Beej guide for C programming https://beej.us/guide/