3.4函数重载注意事项
#include <iostream>
using namespace std;
void func(int &a)
{
cout << "aaa" << endl;
}
void func(const int &a)
{
cout << "bbb" << endl;
}
void func2(int a,int b=10)
{
cout << "ccc" << endl;
}
void func2(int a)
{
cout << "ddd" << endl;
}
int main3_4()
{
system("pause");
return 0;
}
3.3函数重载
#include <iostream>
using namespace std;
void func()
{
cout << "aaa" << endl;
}
void func(int a)
{
cout << "bbb" << endl;
}
void func(double a)
{
cout << "ccc" << endl;
}
int main3_3()
{
func(0);
system("pause");
return 0;
}