上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 98 下一页
摘要: 例子一:/**根据以下条件进行计算:*1、 结构体的大小等于结构体内最大成员大小的整数倍*2、 结构体内的成员的首地址相对于结构体首地址的偏移量是其类型大小的整数倍,比如说double型成员相对于结构体的首地址的地址*偏移量应该是8的倍数。*/#include#includeusing name... 阅读全文
posted @ 2015-03-02 23:04 Jessica程序猿 阅读(987) 评论(0) 推荐(0)
摘要: 有两个变量a和b,不使用任何中间变量交换a和b。方法一:采用如下方法:a=a+b;b=a-b;a=a-b;这样做的缺点就是如果a、b都是比较大的数,则a=a+b时就会越界。而采用:a=a^b;b=a^b;a=a^b;无需担心越界的问题,这样就比较好 注意不能相等。 阅读全文
posted @ 2015-03-02 17:17 Jessica程序猿 阅读(201) 评论(0) 推荐(0)
摘要: 21 22 23 24 ...20 7 8 9 1019 6 1 2 1118 5 4 3 1217 16 15 14 13 看清以上数字的排列规律,设1点的坐标是(0,0),x方向向右为正,y方向向下为正。例如,7的坐标为(-1,-1)... 阅读全文
posted @ 2015-03-02 17:05 Jessica程序猿 阅读(472) 评论(0) 推荐(0)
摘要: 1 x=x+1,x+=1,x++,哪个效率最高?为什么?解析:x=x+1最低,因为它的执行过程如下:1)读取右x的地址。2)x+13)读取左x的地址4)将右值传给左边的x(编译器并不左右x的地址相同)。x+=1其次,其执行过程如下:1)读取右x的地址2)x+13)将得到的值传给x(因为x的地址已经读... 阅读全文
posted @ 2015-03-02 12:33 Jessica程序猿 阅读(1431) 评论(0) 推荐(0)
摘要: 1 类型转换当执行算术运算时,操作数的类型如果不同,就会发生转换,数据类型一般朝着浮点精度高、长度更长的方向转换,整数型如果转换为signed不会丢失信息,就转换为signed,否则转换为unsigned。K&R C所采用无房户后保留原著,就是当一个无符号类型与int或更小的整型混合使用时,结果类型... 阅读全文
posted @ 2015-02-26 23:04 Jessica程序猿 阅读(1898) 评论(0) 推荐(0)
摘要: 与一个进程关联的ID有6个或更多,如下图所示:与每个进程相关联的用户ID和组ID实际用户ID实际组ID我们实际是谁有效用户ID有效组ID附加组ID用于文件访问权限检索保存的设置用户ID保存的设置组ID由exec函数保存实际用户ID和实际组ID标识我们究竟是谁,这两个字段在登录时取自口令文件中的登录项... 阅读全文
posted @ 2015-02-06 20:03 Jessica程序猿 阅读(1484) 评论(0) 推荐(0)
摘要: 下面两个函数都可用来复制一个现存的文件描述符:#includeint dup(int filedes);int dup2(int filedes,int filedes2); ... 阅读全文
posted @ 2015-02-06 11:33 Jessica程序猿 阅读(3602) 评论(0) 推荐(0)
摘要: Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
posted @ 2015-01-19 08:59 Jessica程序猿 阅读(412) 评论(0) 推荐(0)
摘要: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... 阅读全文
posted @ 2015-01-09 13:23 Jessica程序猿 阅读(381) 评论(0) 推荐(0)
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-01-03 10:33 Jessica程序猿 阅读(190) 评论(0) 推荐(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 98 下一页