C
allnlei
这个作者很懒,什么都没留下…
展开
-
关于char (*p)[] 和char p[]的问题
char (*p)[]是定义一个指向char型数组的指针.char p[]是定义一个数组,p也是指针,只不过是常量.对吧?#include int main(){char (*p)[10] ;char a[10];p=a;}为什么提示[root@localhost ~]# cc test.ctest.c: 在函数 ‘main’ 中:test.c:6:转载 2012-03-29 10:20:05 · 4422 阅读 · 0 评论 -
C++ Character Constants
Sketch:There are three kinds of character constants:Normal character constant;Multicharacter constant;wide-character constant;note: Use wide-character constants in place of multic转载 2012-06-26 11:36:10 · 1502 阅读 · 0 评论 -
C++ Operator Precedence and associativity
Make a foolish drawback today, I realized that the fundament and programming conventions are very important, marked it.The following table lists the precedence and associativity of C++ opera转载 2012-06-28 16:09:16 · 1357 阅读 · 0 评论 -
sscanf(转自百度百科)
目录名称:头文件:返回值:说明:支持集合操作:例子:sscanf() - 从一个字符串中读进与指定格式相符的数据. 函数原型: int sscanf( const char *, const char *, ...); int sscanf(const char *buffer,const char *format,[argument ]...); buffer转载 2012-07-22 21:43:35 · 682 阅读 · 0 评论 -
In C++, what’s a vtable and how does it work?
Vtables: Know by Many Different NamesIt’s worth a few brain cells to remember that a vtable is known by many different names: virtual function table, virtual method table, and even as a dispatch tab转载 2012-08-07 22:52:29 · 632 阅读 · 0 评论 -
c语言 自动类型转换
自动转换遵循以下规则:1) 若参与运算量的类型不同,则先转换成同一类型,然后进行运算。2) 转换按数据长度增加的方向进行,以保证精度不降低。如int型和long型运算时,先把int量转成long型后再进行运算。 a.若两种类型的字节数不同,转换成字节数高的类型b.若两种类型的字节数相同,且一种有符号,一种无符号,则转换成无符号类型3)转载 2013-01-21 16:27:03 · 415 阅读 · 0 评论 -
字节对齐&内存管理
用C语言写程序时需要知道是大端模式还是小端模式。 所谓的大端模式,是指数据的低位保存在内存的高地址中,而数据的高位,保存在内存的低地址中;所谓的小端模式,是指数据的低位保存在内存的低地址中,而数据的高位保存在内存的高地址中。 为什么会有大小端模式之分呢?这是因为在计算机系统中,我们是以字节为单位的,每个地址单元都对应着一个字节,一个字节为8bit。但是在转载 2013-01-21 18:15:14 · 1789 阅读 · 0 评论