Anyway to get return value of c program from command line?

前端 未结 2 1201
小鲜肉
小鲜肉 2020-12-28 12:47

I understand if I write a bash script I can get the return value, but is there anyway to get the return value without scripting, and just command line?

2条回答
  •  情歌与酒
    2020-12-28 13:30

    Yes, the same way you'd do in a Bash script. Run your program like this:

    ./your_program; echo $?
    

提交回复
热议问题