会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
lichongbin
踏平坎坷,方成大道。
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
下一页
2014年8月28日
全局变量的初始化
摘要: 全局变量会被初始化为0,这是一直以来脑海中的概念。对于全局对象的理解就是,类有构造函数,在构造函数里可以初始化成员变量。我自己写程序也采用这个原则。其实对于全局对象,对象的成员变量也被编译器初始化为0.示例代码:class A{public: int m_value;};A g_a;void ...
阅读全文
posted @ 2014-08-28 17:08 lichongbin
阅读(791)
评论(0)
推荐(0)
2014年8月27日
nmake学习笔记2
摘要: makefile中的“@<<”看起来很奇怪,查很多地方都没有结果。写了两个示例比较其结果:如果makefile如下:All:main.obj func.obj link $**.cpp.obj: cl /c $< clean: erase *.obj erase *.exe输出...
阅读全文
posted @ 2014-08-27 16:04 lichongbin
阅读(246)
评论(0)
推荐(0)
2014年8月22日
Big Endian与Litter Endian
摘要: Big Endian是大端,Litter Endian是小端,意思很明了,但是很难记住谁是谁.每次涉及到这个概念的时候,我都会GOOGLE一下,浪费精力。怎样才能永远记住他们呢?网上搜索了一下,有很多人都存在这样的困惑,有人提出了一个比较好记的方法:Big Endian和Litter Endian被...
阅读全文
posted @ 2014-08-22 14:33 lichongbin
阅读(439)
评论(0)
推荐(0)
2014年8月21日
nmake学习笔记
摘要: 1、命令行中调用nmake的基本语法:namke/fmakefile/xstderrfile[macrodefs][targets]其中makefile为makefile文件,/x stderrfile为可选参数,即把nmake错误存储到文件stderrfile。2、makefile的主要语法:2....
阅读全文
posted @ 2014-08-21 10:53 lichongbin
阅读(5391)
评论(0)
推荐(0)
2014年8月18日
重载操作符
摘要: 重载操作符、转换函数
阅读全文
posted @ 2014-08-18 10:38 lichongbin
阅读(162)
评论(0)
推荐(0)
2014年8月14日
offsetof的意义
摘要: offsetof是求类的成员变量的偏移量,如果成员变量是类定义的第一个变量,那他的偏移量应该是0.但是引入继承之后,就要额外考虑了。下面的代码说明了这个问题:#define AFX_NOVTABLE//#define AFX_NOVTABLE __declspec(novtable)class AF...
阅读全文
posted @ 2014-08-14 16:33 lichongbin
阅读(441)
评论(0)
推荐(0)
深入分析linux内核源码
摘要: http://oss.org.cn/kernel-book/index.htm
阅读全文
posted @ 2014-08-14 14:53 lichongbin
阅读(167)
评论(0)
推荐(0)
2014年8月13日
virtual与static
摘要: virtual与static不能同时作用于一个函数。根据面向对象的理论,virtual的成员函数是可以变子类覆盖的,是实现多态的重要手段。而static作用的成员函数表示该函数仅属于某个类。下面是实验的代码:class A{ static virtual int Get() { return ...
阅读全文
posted @ 2014-08-13 16:12 lichongbin
阅读(1974)
评论(0)
推荐(0)
this指针的值
摘要: this指针指向的是对象的地址,与对象第一个成员变量的关系是怎样的呢?看下面这个例子:struct CPlex{ CPlex* pNext; void* data() { return this+1; }};int main(int argc, char* argv[]){ CPlex p; voi...
阅读全文
posted @ 2014-08-13 14:04 lichongbin
阅读(231)
评论(0)
推荐(0)
2014年7月11日
Windows Graphics Programming Win32 GDI and DirectDraw第六章疑问
摘要: 《Windows Graphics Programming Win32 GDI and DirectDraw》6.1节中有这样的描述:The Windows NT/2000 graphics engine uses signed fixed-point numbers to represent co...
阅读全文
posted @ 2014-07-11 09:45 lichongbin
阅读(349)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
下一页
公告