摘要: 转载自http://liouwei20051000285.blog.163.com/blog/static/2523674200911535253736/在OnCreat()中创建控件在OnInitUpdate()中初始化控件 int CYourView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFormView::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code ... 阅读全文
posted @ 2013-01-12 18:23 yurius 阅读(616) 评论(0) 推荐(0) 编辑
摘要: #include#includetypedef struct node_t{int val;struct node_t* front;struct node_t* back;}node;node* creatdlist(node* head){int type_len;node* p=head;printf("输入链表长长度是:");scanf("%d",&type_len);head->front=NULL;while(type_len--){int type_val;node* r=(node*)malloc(sizeof(node)) 阅读全文
posted @ 2013-01-12 13:11 yurius 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include #includeint num[10]={1,5,2,6,7,3,8,0,4,22};void swap(int* a,int*b){int tmp;tmp=*b;*b=*a;*a=tmp;}void sort(int* s_num,int left,int right){if(left>=right)return;int mid_elm=(left+right)/2;swap(&s_num[left],&s_num[mid_elm]);int last=left;for(int i=left+1;i<=right;i++)if(s_num[i]{ 阅读全文
posted @ 2013-01-12 13:10 yurius 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 原则1、数据成员对齐规则:结构(struct或联合union)的数据成员,第一个数据成员放在offset为0的地方,以后每个数据成员存储的起始位置要从该成员大小的整数倍开始(比如int在32位机为4字节,则要从4的整数倍地址开始存储)。原则2、结构体作为成员:如果一个结构里有某些结构体成员,则结构体成员要从其内部最大元素大小的整数倍地址开始存储。(struct a里存有struct b,b里有char,int,double等元素,那b应该从8的整数倍开始存储。)原则3、收尾工作:结构体的总大小,也就是sizeof的结果,必须是其内部最大成员的整数倍,不足的要补齐。有效对齐字节数=min(数据类 阅读全文
posted @ 2013-01-12 13:09 yurius 阅读(146) 评论(0) 推荐(0) 编辑