class Complex{
public:
int Add(int x,int y){
return x + y;
}
int operator()(int x,int y){
return x + y;
}
};
void test01(){
Complex complex;
cout << complex.Add(10,20) << endl;
//对象当做函数来调用
cout << complex(10, 20) << endl;
}
2024-04-17 08:25:53 阅读次数:42
class Complex{
public:
int Add(int x,int y){
return x + y;
}
int operator()(int x,int y){
return x + y;
}
};
void test01(){
Complex complex;
cout << complex.Add(10,20) << endl;
//对象当做函数来调用
cout << complex(10, 20) << endl;
}
【密码学】Miller-Rabin素性检测(C++代码实现)
【密码学】凯撒密码解密(C++代码实现)
【Linux】nm命令|查看动态库包含的函数符号
【C++】堆排序(基于最小堆的直接选择排序)
【C++】构造顺序栈
【C深剖】变量定义与数据存取本质
【C初阶】预处理
【C深度解剖】取模与取余
方法就是一个代码片段. 类似于 C 语言中的 "函数"。
缺省参数是声明或定义函数时为函数的参数指定一个缺省值。在调用该函数时,如果没有指定实参,则采用该形参的缺省值,否则使用指定的实参,缺省参数分为全缺省和半缺省参数。(有些地方把缺省参数也叫默认参数)
文章
29774
阅读量
4154490
2025-02-18 07:28:44
2025-02-18 07:28:44
2025-02-14 08:30:05
2025-02-14 08:30:05
2025-02-12 09:28:40
2025-02-11 09:38:01
2023-05-15 10:00:33
2023-03-08 10:27:24
2023-02-07 10:34:04
2023-04-18 14:14:13
2023-03-30 09:59:46
2023-03-14 11:26:53