I have a simple C-program \"./my_program\"
#include
int main (int argc , char **argv) {
unsigned int return_result = 0x474
Exit codes on Unix are restricted to a single byte. If you want to output more, you could write it to stdout or to a file instead.
Then why does the C standard decree that main
returns int
and not char
? I have no idea...
The value returned from main can be printed using echo $? after you are done with the execution. The return value from main is generally used to indicate the execution status. The max value is limited to 512. If you try to return a greater value than 512, 512%val would be set in $?.