Where does the returned value for 'main' function go?

前端 未结 4 711

In C, a function always returns its value to the calling function and never to itself (if return type is not void). Like,

i         


        
4条回答
  •  轮回少年
    2021-01-15 02:58

    Where does the returned value for 'main' function go?

    It is returned to the calling process.

    On a POSIX compliant systems if the calling parent process were a C program it could at least retrieve the lowest 8bit of its child's return value by calling wait() or waitpid() after the child ended.

提交回复
热议问题