07 2008 档案
摘要:一、在调试模式下,new操作符号通过宏定义转换成了调试版本。 在文件头经常可以发现以下语句: #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif 其中,将new定义为DEBUG_NEW 二、DEBUG_NEW的处理 调试版本的new操作函数:void* ...
阅读全文
摘要:C++ Class Templates are used where we have multiple copies of code for different data types with the same logic. If a set of functions or classes have the same functionality for different data types, ...
阅读全文
摘要:SAP useful website SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips Configuration modules are Material Management, Production Planning, Sales/Distribution, Financial, Contro...
阅读全文
posted @ 2008-07-02 12:22
能巴
摘要:short usData = 0x1122; char *pucData = (char*)&usData; bool bBigEndian = (*pucData == 0x22);
阅读全文
摘要:1. '\0'----字符串结束符。代表了0x00。 2. strcpy,strcat等函数,期待'\0'在源字符串中的出现。必须出现才能copy或连接成功。 3. 最好在每次使用前均使用memset(&buf,0,sizeof(buf))清空数据区,保证没错
阅读全文
摘要:char string[1]; // string[10] is the boundary example to tell the extra '0' in a c style string will also be copied when copying. char *str1="0123456789"; strcpy(string, str1); // 11 char will be cop...
阅读全文
摘要:Things to Remember:在一个独立的语句中将 new 出来的对象存入智能指针。如果疏忽了这一点,当异常发生时,可能引起微妙的资源泄漏。 下面这个函数调用还是可能泄漏资源。为什么? processWidget(std::tr1::shared_ptr(new Widget), priority()); ...
阅读全文
摘要:1. STL的auto_ptr 缺点: 1)一个对象只能被一个auto_ptr所拥有,即所有权转移问题。 2)因此,它不能用在STL的container中,所以,非常不实用。 2. Boost的shared_ptr TR1中的std::tr1::shared_ptr就够了(#include ,use std :: tr1 :: shared_ptr using the VS2008 featur...
阅读全文
摘要:vs2008下安装boost 1.下载boost_1_34_1压缩文件,解压缩到d:\boost_1_34_1\目录下 2.编译bjam 从vs2008的工具菜单进入命令提示窗口"Visual Studio 2008 Command Prompt"(一定要从这进),cd到c:\boost_1_34_1\tools\jam\src下执行build.bat,会在c:\boos...
阅读全文

浙公网安备 33010602011771号