文章目录
一、概述
二、内容
6.1、函数基础
#include "LocalMath.h"
#include <iostream>
using std::cout; using std::endl;
int main()
{
// pass a literal to fact
int f = fact(5); // f equals 120, i.e., the result of fact(5)
cout << "5! is " << f << endl;
// call fact on i and print the result
int i = 5;
int j = fact(i);
cout << i << "! is " << j << endl;
// call fact on a const int
const int ci = 3;
int k = fact(ci);
cout << ci << "! is " << k << endl;
return 0;
}
6.2、参数传递
这个难理解
6.3、返回值类型和Return语句
6.4、函数的重载
6.5、特殊用途语言特性
constexpr
调试
6.6函数匹配
6.7、函数指针
函数指针形参
6.8、小结
6.9、术语表