The return value is passed back to the invoker when the program terminates. It's nice to tell the invoker how you went.
system() for example might use such a value: http://www.cplusplus.com/reference/c...ib/system.html
and you might want to write a little math program or something, eg:
Which pointlessly adds 2 numbers like so:Code:#include <stdlib.h> int main(int argc, char* argv[]) { int res = 0; if(argc >= 3) res = atoi(argv[1]) + atoi(argv[2]); return res; }
./pointless.exe 5 10
= 15