每天看书总有点小收获 以后就把收获添加到这里 积少成多嘛![]()
2009-5-9
今天看俄罗斯方块的VC原代码时发现有 register const UINT wide = 20;这段,以前没有发现前面有register的申明变量的。查看msdn中的说明
The register keyword specifies that the variable is to be stored in a machine register, if possible.
The 32-bit compiler does not honor user requests for register variables. Instead it makes its own register choices when global optimizations are on. However, all other semantics associated with the register keyword are honored by the 32-bit compiler.
一些编译器可以把register修饰的变量优化为寄存器变量,使程序性能得到优化,不过现在很多编译器即使不加register修饰也可能会自动优化。
2009-6-14
对于普通函数对象结束时,自动调用析构函数,对于用new运算符创建的函数对象,需要使用delete运算符才能调用析构函数
2009-7-4
symbian 中 .hrh文件的作用是用来定义命令、ID等,例如菜单命令,对话框上的控件的ID。它一般既要被.rss引用,又要被.cpp引用
浙公网安备 33010602011771号