大端小端问题:内存从左到右读史从高低址到低地址,故为小端字节对齐问题:常见的32位系统struct A{ int a; char b; short c;};struct B{ char b; int a; short c;};A占8字节,B占12字节。union{ int a; char b[2];...
分类:
编程语言 时间:
2014-09-27 01:53:08
阅读次数:
176
一、C语言的强制转换1.1 隐性转换 不同数据类型之间赋值和运算,函数调用传递参数等等,由编译器完成 int nTmp = 10; short sTmp = nTmp; //这个时候就需要注意转换时数据是否溢出(大字节转小字节)1.2 显性转换 在变量的前面加上(Type)进行显性转换,如...
分类:
编程语言 时间:
2014-09-26 19:12:48
阅读次数:
209
通过修改/etc/magic能够增加可识别的文件类型/etc/magic有四个字段:offsetdata-typevaluefile-typeoffset文件中的偏移量,从0开始计算.表示file从该偏移量开始匹配data-type测试类型.文本比较用string,字节比较用offset,两字节比较用short,四字节比较用longvalue用户希望的值,若..
分类:
其他好文 时间:
2014-09-26 11:22:09
阅读次数:
169
private void setDataValidationList(short firstRow,short endRow,short firstCol, short endCol,String data,HSSFSheet sheet ){ //设置下拉列表的内容 ...
分类:
其他好文 时间:
2014-09-26 10:21:48
阅读次数:
324
1.php语言标记 在php.ini文件中将short_open_tag设置为on,php将会识别语言标记2.php语言注释 // # /* */ 多行注释3.可变变量4.字符串 5.面向对象的__get()和__set() __get($property_name); //该属性应该...
分类:
Web程序 时间:
2014-09-25 18:32:47
阅读次数:
171
一. 回顾指针概念: 今天我们又要学习一个叫做指向另一指针地址的指针。让我们先回顾一下指针的概念吧! 当我们程序如下申明变量: short int i; char a; short int * pi; 程序会在内存某地址空间上为各变量开辟空间,如下图所示。 内存地址→6 7 8 9 10 11 12...
分类:
其他好文 时间:
2014-09-25 01:28:08
阅读次数:
202
题目链接In a rooted tree, thelowest common ancestor(or LCA for short) of two verticesuandvis defined as the lowest vertex that is ancestor of both that tw...
分类:
其他好文 时间:
2014-09-24 22:50:17
阅读次数:
296
??
一个集合可否排序,要看系统知不知道排序的规则,像内建的系统类型,int ,string,short,decimal这些,系统知道怎么排序,而如果一个集合里面放置的是自定义类型,比如自己定义了一个Product类型,要把它排序,系统是不知道怎么办的。
那么,如何告知系统排序的规则呢?有以下几种方法:
1:对类实现IComparable接口,示例如下:
代码1
...
分类:
其他好文 时间:
2014-09-24 19:44:17
阅读次数:
212
大端法:高位字节排放在内存低地址端,低位字节排放在内存的高地址端。小端法:低位字节排放在内存的低地址端,高位字节排放在内存的高地址端。看一个unsigned short 数据,它占2个字节,给它赋值0x1234。若采用的大端法,则其低地址端应该存放的是0x12;若采用的小端法,则其低地址端应该存放的...
分类:
其他好文 时间:
2014-09-23 21:31:45
阅读次数:
270
Most of the programs we have seen so far are transient in the sense that they run for a short time and produce some output, but when they end, their d...
分类:
其他好文 时间:
2014-09-23 00:45:03
阅读次数:
191