流云の剑舞秋风

吾生也有涯 而知也无涯

博客园 首页 新随笔 联系 订阅 管理

2005年5月8日 #

摘要: 全局变量的定义一直不知道怎么弄,困绕很久,终于在vckbase之阿荣的BLOG上找到答案了 http://blog.vckbase.com/arong/archive/2004/05/28/294.aspx 简述如下:工程中有xx.cpp,yy.cppxx.h,yy.h等,在xx.cpp里的函数外部分定义变量int test=5;为了在yy.cpp里使用刚刚定义的tes... 阅读全文
posted @ 2005-05-08 23:04 流云 阅读(762) 评论(0) 推荐(0) 编辑

摘要: ①对于一般常量,const在类型说明符的前面或者后面,都是一样的.eg: const int i=9; int const i=9; ②使用const修饰指针时,会由于const位置不同而含义不同. eg: char * const p=str1;p为常量指针,p的指向不可以变,而*p可更新,即语句p=str2 非法,语句*p="C"正确. const char * p=str1;p... 阅读全文
posted @ 2005-05-08 23:00 流云 阅读(484) 评论(0) 推荐(0) 编辑

摘要: C允两者不一致,而C++则不允许. //...... void *f; int i=1,*p; f=&i; p=(int*)f; f=p; cout<<"p is "<<p<<*p; cout<<"f is "<<f<<*f; // void... 阅读全文
posted @ 2005-05-08 22:57 流云 阅读(394) 评论(0) 推荐(0) 编辑

摘要: 1.new 用法:指向对应类型的指针=new 类型描述符 a. 一个机器字长 int *p; p=new int; b. 一个机器字长,并赋值 int *p; p=new int(20); c. 多个字长,按数组或指针引用 int *p; p=new int [20]; 2.delete 用法:delete 指针名 指针是数组... 阅读全文
posted @ 2005-05-08 22:56 流云 阅读(320) 评论(0) 推荐(0) 编辑

摘要: 类的构造函数 阅读全文
posted @ 2005-05-08 22:54 流云 阅读(381) 评论(0) 推荐(0) 编辑

摘要: 成员初始化 阅读全文
posted @ 2005-05-08 22:54 流云 阅读(302) 评论(0) 推荐(0) 编辑

摘要: 对话框绘图 阅读全文
posted @ 2005-05-08 22:49 流云 阅读(3799) 评论(4) 推荐(0) 编辑

摘要: 在此篇之前我们已经学会了在窗口显示图形,更准确的说是在窗口指定位置显示图形或文字,我们使用的坐标单位是象素,称之为设备坐标。看下面语句: pDC->Rectangle(CRect(0,0,200,200)); 画一个高和宽均为200个象素的方块,因为采用的是默认的MM_TEXT映射模式,所以在设备环境不一样时,画的方块大小也不一样,在1024*768的显示器上看到的方块会比640*480... 阅读全文
posted @ 2005-05-08 17:26 流云 阅读(772) 评论(0) 推荐(0) 编辑

摘要: 1#include 2#include 3inttemp,m[30][30]={0,}; 4voidHelix(intmin,intmax) 5{ 6for(inti=min;i>N; 22if(N30) 23break; 24max=N-1; 25temp=1... 阅读全文
posted @ 2005-05-08 17:00 流云 阅读(678) 评论(0) 推荐(0) 编辑

摘要: 内存DC 缓存作图 阅读全文
posted @ 2005-05-08 14:33 流云 阅读(547) 评论(0) 推荐(0) 编辑