摘要: #include <iostream>#include <new>using namespace std;const int chunk = 16;class Foo{public: int val() { return __val; } Foo() { __val = 0; }private: int __val;};char *buf = new char[sizeof(Foo) * chunk];int main(int argc, char* argv[]){ Foo *pb = new (buf)Foo; if (pb->val() ... 阅读全文
posted @ 2012-08-30 15:50 lichongbin 阅读(123) 评论(0) 推荐(0) 编辑