Search code examples
cembeddedembed

how return keyword work in main function or any user defined function?


what basis that does function return 0 or 1 o especially in main()? is it possible that -1 is the return value?


Solution

  • By placing void in front of any function definition, you make it so that the function does not need to return a value. For example:

    void test(void)
    {
        ...
    }
    

    Would not return anything.