Sometimes functions are not members of a class called global functions (全局函数)
Function Definitions with Mutiple Paramenters:
function prototype (declaration): int test ( int );
function header: int test ( int b ) ;
signature: test ( int );
cout<<(1+rand()%6); 生成1-6随机数
srand(time(0));取当前时间 保证随机
Four scopes for an identifier:
1.function scope
2. global namespace scope
3. local scope and
4. function-prototype scope
C++ enables several functions of the same name to be defined, as long as they have different signatures. (重载要求有不同的签名)
—————————————————————————————————————————
Recursion 递归
base case: is the only case that the recursive function know how to solve.
If the function is called with a base case, the function simply returns a result.