
c++笔记
疯狂的橡树
code can change world
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c++成员与友元
#ifndef __RECT_H__#define __RECT_H__class Rectangle{private: double x1,y1,x2,y2; double lenth,wide;public: Rectangle(double xx1=0,double yy1=0,double xx2=0,double yy2=0); Rectangle(const Rec原创 2013-05-01 23:11:10 · 819 阅读 · 0 评论 -
c++中发现的一些问题
#includeusing namespace std;class test{private: int a,b;public: test(int aa=0,int bb=0,int cc=3):c(cc)//常数据成员只能用初始化列表 //而且其值不能被更新 { a=a原创 2013-05-01 23:09:40 · 911 阅读 · 0 评论 -
写程序作业时发现的一些关于类的成员访问权限神奇的东西
#include using namespace std;class test{private: int a,b;public: test(int aa,int bb){a=aa;b=bb;} void fun(test &t) { t.a=-t.a; cout<<t.a<<' '<<t.b<<endl; }原创 2013-05-22 00:34:30 · 1104 阅读 · 0 评论 -
c++异常的一些心得
#include using namespace std;class test1{public: test1() { cout<<"test1 构造"<<endl; } ~test1() { cout<<"test1 析构"<<endl; }};class test2:public test1{原创 2013-05-30 22:58:54 · 974 阅读 · 0 评论