C++
文章平均质量分 74
himeat
这个作者很懒,什么都没留下…
展开
-
class 的 new 和 delete 操作
针对类的成员变量,new/delete操作,constructor和destructor的调用顺序,在Linux下写了几个测试程序:src file 1: AB.h #include iostream>using namespace std;class A{ public: A() { cout " Class A is newed "; } ~A() {原创 2008-02-19 21:25:00 · 1408 阅读 · 0 评论 -
UL格式
~0UL>>1 creates a bit mask (32 bit machine example) where the high order bit is clear and all the rest of the bits are set:Code:01111111111111111111111111111111 Source code: printf ("0UL=[%原创 2008-06-10 18:34:00 · 852 阅读 · 0 评论 -
C++ FAQ list
A good C++ FAQ list.http://www.parashift.com/c++-faq-lite/index.html转载 2008-06-10 18:34:00 · 353 阅读 · 0 评论 -
strcpy, strncpy and strlcpy
===============================================================char buffer1[10]="12345678";char *pt = "hello1234567abcdefghijkABCDEFGHIJK!!!";strlen(buffer1) is 8strlen(length) is 37==============原创 2008-09-12 23:44:00 · 840 阅读 · 0 评论