i have created a program in C. I would like to know, how to check the value which my program returns ... I mean, at the end of the code my program return zero if no error occurred. If an error occurred my program should return 1. And that's the problem, i want to see if really 1 is returned if something went wrong. For memory leaks, etc I am using valgrind on Linux. Thank you for any help.
You can just print the special shell variable $?
, e.g.:
$ ./my_program ; echo "status = $?"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With