摘要: 许多实际的计算机系统对基本类型数据在内存中存放的位置有限制,它们会要求这些数据的首地址的值是某个数k(通常它为4或8)的倍数,这就是所谓的内存对齐,而这个k则被称为该数据类型的对齐模数(alignment modulus)。当一种类型S的对齐模数与另一种类型T的对齐模数的比值是大于1的整数,我们就称类型S的对齐要求比T强(严格),而称T比S弱(宽松)。这种强制的要求一来简化了处理器与内存之间传输系... 阅读全文
posted @ 2010-11-05 21:59 Cranny 阅读(1414) 评论(0) 推荐(0) 编辑
摘要: //------------------- 公用的常量和类型 ---------------------------- #include #include #include #include //函数结果状态代码 #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #... 阅读全文
posted @ 2010-10-24 23:03 Cranny 阅读(310) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #define N 5 #define M 9 void dfs(int x, int y); void pop(void); void print(void); void push(int x, int y); int maze[N][M]; struct node { int x; int y; }; int to... 阅读全文
posted @ 2010-10-24 22:36 Cranny 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 转自:http://hi.baidu.com/wicked_boy/blog/item/bf3f04fc21134e87b901a040.html 阅读全文
posted @ 2010-10-23 21:38 Cranny 阅读(761) 评论(1) 推荐(0) 编辑
摘要: 文章转自:http://www.cnblogs.com/pure/archive/2010/09/21/1832705.html两者先后顺序不同,构造函数生成本类的对象,但没有产生窗口,OnCreate后窗口产生, 然后才是视图的OnInitialUpDate,一般在这里对视图的显示做初化。 OnCreate只是产生VIEW的基本结构和变量,而在OnInitialUpDate中,主要对视图中控件等... 阅读全文
posted @ 2010-10-14 14:15 Cranny 阅读(1248) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; class Furniture { public: Furniture(){} void SetWeight(unsigned i) { weight = i; } unsigned GetWeight() { return weight; } protected: unsigned weight; }; ... 阅读全文
posted @ 2010-10-14 13:56 Cranny 阅读(268) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; class OBJ1 { public: OBJ1() { cout<<"construct OBJ1"<<endl; } }; class OBJ2 { public: OBJ2() { cout<<"construct OBJ2"<<endl; } }; class Base1 { public: Ba... 阅读全文
posted @ 2010-10-14 13:47 Cranny 阅读(190) 评论(0) 推荐(0) 编辑
摘要: //account.h #pragma once #include using namespace std; class Account { public: Account(void); ~Account(void); Account(unsigned accNo,float balan = 0.0); int AccountNo(); float AcntBalan(); s... 阅读全文
posted @ 2010-10-14 13:02 Cranny 阅读(213) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; class Person { public: Person(char *pN = "no name") { cout<<"Constructing "<<pN<<endl; pName = new char[strlen(pN) + 1]; if (pName) { strcpy(pNa... 阅读全文
posted @ 2010-10-13 19:11 Cranny 阅读(277) 评论(1) 推荐(0) 编辑
摘要: #include #include using namespace std; class Student { public: Student(char *pName = "no name", int ssId = 0) { id = ssId; strcpy(name,pName); cout<<"constructing new student "<<name<<endl... 阅读全文
posted @ 2010-10-12 21:48 Cranny 阅读(1320) 评论(0) 推荐(0) 编辑