- 博客(4)
- 资源 (7)
- 收藏
- 关注
翻译 -->操作符
stackoverflow上的一道题,聪明的你知道-->是什么运算符吗?提问的人说他看了"Hidden Features and Dark Corners of C++/STL" on comp.lang.c++.moderated,居然发现了这个运算符,结果在Visual Studio 2008 and G++ 4.4.还都编过了。。#include int main(){
2012-01-05 13:15:30
294
原创 ()操作符的使用
本文参考MSDN,介绍()操作符函数调用class MultValue{ int mnFactor; public: MultValue(int lsh) :mnFactor(lsh) { } void operator ( ) ( int& elem ) const { elem *= mnFactor; }};int main (){ int elems
2011-12-27 14:18:53
342
原创 查看验证float存储格式
float型,和double型的存储格式,如图验证计算:float fnum = 1.123456;int f2n = *(int*)&fnum;cout << fnum << endl;cout << hex << f2n << endl;cout << dec;int strnum[32];int i;for ( i=0; i<32; i++ ){ str
2011-12-26 16:35:58
579
原创 用类静态函数指针实现的RTTI
oo中的优质代码,单例模式、类的静态函数指针实现RTTI本人对其进行裁剪,简单直接代码展现,把5个函数用宏的形式封装,便于插进代码中使用typedef void* (*TypeId)();#define TYPEINFO() \ static void* CreateType() { return 0; } \ static TypeId StaticType()
2011-12-24 00:32:51
429
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人