摘要:
#include <iostream> /* #pragma pack(4) */ using std::cout; using std::endl; //1 4 2 1 struct x { char a; int b; short c; char d; }MyStructX;//12 struc 阅读全文
摘要:
初步用C++实现单例模式,暂未考虑线程安全问题 #include <stdio.h> #include <iostream> using std::cout; using std::cin; using std::endl; // 单例模式的设计需求:一个类只能有一个对象 // 思路:创建的对象肯定 阅读全文