雕刻时光

just do it……nothing impossible
随笔 - 547, 文章 - 0, 评论 - 82, 阅读 - 86万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  CPP学习

摘要:http://blog.csdn.net/haoel/article/details/1948051 阅读全文

posted @ 2013-10-01 21:29 huhuuu 阅读(206) 评论(0) 推荐(0) 编辑

摘要:CPen* PenOld,PenNew; CBrush* BrushOld,BrushNew; //选用库存黑色画笔 PenOld = (CPen*)pDC->SelectStockObject(BLACK_PEN); //选用库存浅灰色画刷 BrushOld = (CBrush*)pDC->SelectStockObject(LTGRAY_BRUSH); pDC->Rectangle(100,100,300,300); //关联GDI 库存对象 PenNew.CreateStockObject(WHITE_PEN); pDC->S... 阅读全文

posted @ 2013-05-16 10:26 huhuuu 阅读(708) 评论(0) 推荐(0) 编辑

摘要:惭愧,队列栈集合的容器操作滚瓜烂熟,但是就这个不熟,最近快毕业了,毕业论文上,老师说开静态数组不科学,所以就用这个吧,囧转下别的博客动态创建二维vector数组二维vectorvector<vector <int> > ivec(m ,vector<int>(n)); //m*n的二维vector动态创建m*n的二维vector方法一:vector<vector <int> > ivec;ivec.resize(m);for(int i=0;i<m;i++) ivec[i].resize(n);方法二:vector<vec 阅读全文

posted @ 2013-05-10 21:13 huhuuu 阅读(226) 评论(0) 推荐(1) 编辑

摘要:View Code [cpp] view plaincopy//适用于正整数 template <class T> inline void scan_d(T &ret) { char c; ret=0; while((c=getchar())<'0'||c>'9'); while(c>='0'&&c<='9') ret=ret*10+(c-'0'),c=getchar(); } ②[cpp] view plaincopy//适用于正负整数 template 阅读全文

posted @ 2012-04-04 19:38 huhuuu 阅读(329) 评论(0) 推荐(0) 编辑

摘要:注意点:class base{protected://抽象类成员变量要用protected,而用private子类明显不可以调用 double x;public: base(double a){x=a;} virtual void s()=0;//加个const就不对了 virtual void v()=0;};View Code #include<iostream>using namespace std;class base{protected: double x;public: base(double a){x=a;} virtual void s()=0;//加个const就 阅读全文

posted @ 2011-05-02 19:57 huhuuu 阅读(249) 评论(0) 推荐(0) 编辑

摘要:View Code #include<iostream>#include<cstring>using namespace std;class mystring{public: mystring(char *s); mystring(); ~mystring();//虚构函数用来释放动态内存 void addstring(char *s);//连接两个字符串 void stringup(char *s);//字符串大写换小写 void change(char *s);//改变字符串 void show();//输出字符串private: int len; char *p; 阅读全文

posted @ 2011-04-17 19:24 huhuuu 阅读(406) 评论(0) 推荐(0) 编辑

摘要:View Code #include<iostream>using namespace std;class Car;//为了使class Boat中可以定义Car类,可以暂时先声明可以引用Car类class Boat{public: Boat(int tBweight=0) { Bweight=tBweight; } friend class Car; friend void getTotalWeight(Car &C,Boat &B);//共同友元函数在每个引用的类都要定义private: int Bweight;};class Car{public: Car(i 阅读全文

posted @ 2011-04-04 15:56 huhuuu 阅读(832) 评论(0) 推荐(0) 编辑

摘要:View Code #include<iostream>#include<string.h>using namespace std;class student{private: char name[10]; int score;public: char* gan(student &student1,student &student2); friend void disp(student &student1);//友元函数 student(char tname[10]="",int tscore=0)//构造函数 { strcm 阅读全文

posted @ 2011-04-04 15:18 huhuuu 阅读(236) 评论(0) 推荐(0) 编辑

摘要:要知道,a[100]字符串的首地址与char *a 是不一样的,a[100]字符串的首地址不是指针,char *a就是指针!!!View Code //swap(char *a,char *b)#include<iostream>#include<string.h>using namespace std;void swap(char *a,char *b){ int al,bl,i; al=strlen(a)+1; bl=strlen(b)+1; if(al<bl)al=bl; int temp; for(i=0;i<al;i++) { temp=a[i]; 阅读全文

posted @ 2011-03-08 19:59 huhuuu 阅读(1621) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示