摘要: 子类在继承父类的成员函数时,有public,protected,private继承方式,如果在父类是private则无论在子类还是外部都无法访问,如果在父类是public,protected则按照小于等于的原则进行继承。 阅读全文
posted @ 2012-08-14 22:59 l851654152 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 函数重载通过函数参数,和函数参数类型,以及参数个数判断,1.void output(int a int b)int output (int a, int b)不能构成重载2.void output(int a int b = 5) void output(int)也不能构成函数重载没有构造函数,默认构造函数由编译器生成。 阅读全文
posted @ 2012-08-14 21:58 l851654152 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 在C语言中声明结构体变量需要加上struct关键字,而c++中不需要加。 阅读全文
posted @ 2012-08-14 20:34 l851654152 阅读(132) 评论(0) 推荐(0) 编辑