“初始化 定义 赋值” 之间的联系与区别
 
           本来很早之前就想写个blog,说说这三个家伙的区别和联系,三者之间各种联系,很难比较清楚的讲明白,感觉当时好像分析思路还不够“完整”。今天遇到别人抛出来的一个问题。根本的问题是和初始化和赋值有关系,于是留下这个blog。
#include 
struct _ANIBMP
{
        int FirstNu...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 23:04:54   
                                阅读次数:
384
                             
                    
                        
                            
                            
                                1.如何向接受结构参数的函数传入常量值?
c99标准中引入“复合字面量”(compound literals),它的一种形式就可以允许结构常量。例如,向假定的plotpoint函数
传入一个坐标对常量。
plotpoint((struct point){1,2});与制定初始式结合,也可以用成员名称确定成员值:
plotpoint((struct point){.x=1, .y=2});
...
                            
                            
                                分类:
编程语言   时间:
2014-07-22 23:04:35   
                                阅读次数:
363
                             
                    
                        
                            
                            
                                #include #include using namespace std; struct 
BTNode { int v; // default positive Integer. BTNode *pLeft; BTNode *pRight; 
BTNode(int x) : v(x), pLeft(...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 23:00:54   
                                阅读次数:
294
                             
                    
                        
                            
                            
                                原地址:http://www.cnblogs.com/U-tansuo/p/ios_basis_info.html1、获取设备类型 (Iphone/ipad 
几?)#import "sys/utsname.h"-(NSString*)getDeviceVersion{ struct utsname ...
                            
                            
                                分类:
移动开发   时间:
2014-05-12 17:44:02   
                                阅读次数:
546
                             
                    
                        
                            
                            
                                一.内存对齐的初步讲解内存对齐可以用一句话来概括:“数据项只能存储在地址是数据项大小的整数倍的内存位置上”例如int类型占用4个字节,地址只能在0,4,8等位置上。例1:#include 
struct xx{ char b; int a; int c; char d;};int main(){ st...
                            
                            
                                分类:
其他好文   时间:
2014-05-10 19:52:54   
                                阅读次数:
323
                             
                    
                        
                            
                            
                                BFS。wa了一下午,原来是YES,写成了Yes。 1 #include 2 #include 3 
#include 4 #include 5 using namespace std; 6 7 typedef struct node_st{ 8 int x, 
y; 9 in...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 08:48:16   
                                阅读次数:
274
                             
                    
                        
                            
                            
                                epoll函数#include int epoll_create(int size)int 
epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)int epoll_wait(int 
epfd,struct epoll_event...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 00:21:30   
                                阅读次数:
519
                             
                    
                        
                            
                            
                                题目链接区间合并,贪心,需要注意边界情况,LeetCode的数据还是比较好的,这样才能写出健壮的程序。附上代码: 
1 /** 2 * Definition for an interval. 3 * struct Interval { 4 * int start; 5 * 
in...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 00:16:44   
                                阅读次数:
400
                             
                    
                        
                            
                            
                                先用bfs预处理出层次图,然后在层次图上用dfs找增广路径,理论复杂度O(n*n*m)const 
int INF=0xfffffff ;struct node{ int s,t,cap,nxt ;}e[200005] ;int 
m,n,head[10005],level[10005],cnt ...
                            
                            
                                分类:
其他好文   时间:
2014-05-01 20:05:16   
                                阅读次数:
379
                             
                    
                        
                            
                            
                                输入 1500 3150 300100 200 输出结果470 471100 200150 
300470 471 #include #includeusing namespace std;struct node{ int a ; int 
b;}s[100];int compare(const voi...
                            
                            
                                分类:
其他好文   时间:
2014-05-01 19:12:33   
                                阅读次数:
358