摘要: 普通函数的重载跟java没区别 都是同样的方法名,不同的参数。缺省参数的函数#include <iostream>using namespace std;class A{public: void set(int =30,int=5); void count(bool=false);private: int w; int h;};void A::set(int width,int height){ w=width; h=height;}void A::count(bool val){ if(val==true){ cout<<"val的值为真时:"&l 阅读全文
posted @ 2013-03-04 14:41 王世桢 阅读(182) 评论(0) 推荐(0) 编辑