2011年(100)
分类: C/C++
2011-04-22 09:53:43
//C++ Tutorial - Sample code for function overloading void AddAndDisplay(int x, int y) { cout<<" C++ Tutorial - Integer result: "<<(x+y); } void AddAndDisplay(double x, double y) { cout<< " C++ Tutorial - Double result: "<<(x+y); } void AddAndDisplay(float x, float y) { cout<< " C++ Tutorial - float result: "<<(x+y); } |
onezeroone2011-04-24 16:00:44
with different number of parameters and parameters of different type,
different return types are not allowed