What should I do to get the whole return value of c-program from command line?

后端 未结 2 1783
再見小時候
再見小時候 2021-01-18 14:35

I have a simple C-program \"./my_program\"

#include 

int main (int argc , char **argv) {


   unsigned int return_result = 0x474         


        
2条回答
  •  清歌不尽
    2021-01-18 15:00

    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 $?.

提交回复
热议问题