C++
ysbcg
呵呵
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
关于c语言与c++语言的头文件
在c/c++语言中的头文件其实是为了搜寻对应的类型和函数信息的比如在头文件中可以声明一个函数,但这个函数可能定义在任何地方比如一个静态库或者动态导入库lib中,或者可以直接以原代码的方式写在cpp/c文件中头文件提供的服务叫做类型映射(phototype)函数在c/c++语言中也是一种类型函数在声明的时候其实仅仅是说明了对应的函数调用协议,函数名称和参数类型这样就可以明确的指导编译器如何创建这原创 2005-12-25 15:26:00 · 4189 阅读 · 1 评论 -
空指针真的是0么?
<br />我们平常写程序时习惯使用NULL或者0作为空指针,而且已经是习以为常了。<br /> <br />今天在处理一个pointer to member指针时发现返回值为0下意识的以为返回的是个空指针,但是发现确进入了下面的if语句。<br />然后研究了下编译出来的代码,发现空指针值被换成了0xffffffff,因为pointer to member是可能为0的。<br />联想到其他平台有可能空指针实际上不是0的情况,现在实际上x86平台也有不是0的空指针了。<br />这倒是我孤陋寡闻了。<br原创 2010-07-29 13:48:00 · 851 阅读 · 1 评论 -
Bitwise Operations
<br />It's fairly convoluted though very efficient to encode lots of pieces of Boolean information into a single integer variable. Normal arithmetic and logical operations on such integer variables become unintuitive since we're not usually concerned with转载 2011-05-23 10:51:00 · 447 阅读 · 0 评论 -
Effective C++ in the C++0x (C++11) Age
<br />Yesterday, Herb Sutter posted the truly exciting news that the new version of C++ has reached FDIS status. Practically (though not officially) speaking, this means that the new standard for C++ is finished, and we can stop using the code name "C++0x转载 2011-04-20 09:56:00 · 931 阅读 · 0 评论 -
GCC和虚表
最近的一个项目中使用了一个特殊的技术,在VC下编译毫无问题,但到了GCC就遇到了问题——崩溃。研究两天之后发现了一些GCC的实现相关内容,总结一下GCC的实现中虚表指针已经放在对象的最前端,和很早之前版本不一致GCC的pointer to member function是普通指针原创 2011-07-12 10:25:41 · 500 阅读 · 0 评论
分享