This isn't urgent, but I was curious about something, and I figured that someone on this site would have a good answer for me.
Why exactly do we end C programs with return 0;? I know that the main method has a return type int, so it needs to return some sort of int at the end of it, but why is it 0? Also, why does our main method have a return type in the first place? What is calling it?
In UNIX, programs return an exit code to denote success or failure. "0" is the exit code for success. You could return "1" if you needed to signal to a calling process that your program did not terminate normally. For Botball and Link programming in general, this value is not too important.
Braden McDorman
Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.
Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.
Ah okay thanks. That makes sense.
-Daniel Goree
Former...
Senior Project Manager
President
Norman Advanced Robotics (13-0113)
The only time I've ever seen these used is in scripting. They are just there to check if the application broke down or something.