Tell It by Myself…
return means 2 things:
- We stop the function
- We send back (return) a value
Remember if we use void we can’t use the return with value (you can write function with return, but it is meaningless)
The function has precedence relationship. So we usually write the function before the main function (the machine read the code from top to bottom)
But , we use a method called 原型声明
That is, we should
- Declare the function at first
- Write the function definition at last (even after the main function!)
Once there is a return the function would stop