摘要:#include #include using namespace std; bool checkLittleEnd (void) { union test { int a; char b; } t; t.a = 1; return (t.b==1); } int main() { if (checkLittle...
阅读全文
摘要:#include #include using namespace std; class demo { public: static int i; // 这里不可以初始化非const static变量! static const int j = 1; // 1st place to initiate for const static varia...
阅读全文
摘要:#include #include using namespace std; class Person { public: virtual void print(void) { cout << "I am a Person!" << endl; } }; class Chinese: public Person { public: virt...
阅读全文
摘要:#include #include using namespace std; class MyString { public: MyString(const char * s=NULL) { if (s == NULL) { m_string = new char[1]; m_string[...
阅读全文