重载函数
#include <iostream>
using namespace std;
int Add(int x, int y) {//定义第一个重载函数
cout << "int add" << endl;
return x + y;
}
double Add(double x, double y) { //定义第二个重载函数
cout << "double add" << endl;
return x + y;
}
void main()
{
int var = Add(5, 2);
float fvar = Add(10.5, 11.4);
}#include <iostream>
using namespace std;