剪贴板

// begin 20100720 //#include <iostream> // //#define MYMACRO // //int main() //{ // int ia = 9; // // int* pint = &ia; // int* pint2 = const_cast<int*>(pint); // std::cout<< pint2 << std::endl; // //#ifdef MYMACRO_1 // MYMACRO_1 // std::cout << "MYMACRO_1 is defined, MYMACRO_1 = " << MYMACRO_1 << std::endl; //#else // std::cout << "MYMACRO_1 is NOT defined. " << std::endl; //#endif // MYMACRO_1 // //#ifdef MYMACRO_2 // MYMACRO_2=1 // std::cout << "MYMACRO_2 is defined, MYMACRO_2 = " << MYMACRO_2 << std::endl; //#else // std::cout << "MYMACRO_2 is NOT defined. " << std::endl; //#endif // MYMACRO_2 // //#ifdef MYMACRO_3 // MYMACRO_3=123456 // std::cout << "MYMACRO_3 is defined, MYMACRO_3 = " << MYMACRO_3 << std::endl; //#else // std::cout << "MYMACRO_3 is NOT defined. " << std::endl; //#endif // MYMACRO_3 // //#ifdef MYMACRO_4 // MYMACRO_4= 123456 // std::cout << "MYMACRO_4 is defined, MYMACRO_4 = " << MYMACRO_4 << std::endl; //#else // std::cout << "MYMACRO_4 is NOT defined. " << std::endl; //#endif // MYMACRO_4 // //#ifdef MYMACRO_5 // MYMACRO_5= 123456 // std::cout << "MYMACRO_5 is defined, MYMACRO_5 = " << MYMACRO_5 << std::endl; //#else // std::cout << "MYMACRO_5 is NOT defined. " << std::endl; //#endif // MYMACRO_5 // //#ifdef MYMACRO_6 // MYMACRO_5 =123456 // std::cout << "MYMACRO_6 is defined, MYMACRO_6 = " << MYMACRO_6 << std::endl; //#else // std::cout << "MYMACRO_6 is NOT defined. " << std::endl; //#endif // MYMACRO_6 // //#if defined(MYMACRO_7) // MYMACRO_7 = 123456 // std::cout << "MYMACRO_7 is defined, MYMACRO_7 = " << MYMACRO_7 << std::endl; //#else // std::cout << "MYMACRO_7 is NOT defined. " << std::endl; //#endif // MYMACRO_7 // // ////#if MYMACRO // fatal error C1017: invalid integer constant expression //// std::cout << "#if MYMACRO enter! " << std::endl; ////#endif // MYMACRO // //#ifdef MYMACRO // std::cout << "#ifdef MYMACRO enter! " << std::endl; //#endif // MYMACRO // ////#ifdef MYMACRO //// std::cout << "MYMACRO is defined, MYMACRO = " << MYMACRO << std::endl; // You may get C2059 if a symbol //// // evaluates to nothing, as can occur// // when you compile with /Dsymbol=. ////#else //// std::cout << "MYMACRO is NOT defined. " << std::endl; ////#endif // _WANGQI_ // // //int i = 8; // //int j = 9; // //int& ri = i; // //int& rj = j; // //std::cout << &ri << " " << &i << " " << ri << std::endl; // //std::cout << &rj << " " << &j << " " << rj << std::endl; // // //ri = rj; // //std::cout << &ri << " " << &i << " " << ri << std::endl; // // return 0; //} //#include <iostream> // //class Foo //{ //public: // Foo(int i = 7, int j = 8): _i1(i), _i2(_i1) // { // } // // Foo& operator=(const Foo& rhs) // { // if (this != &rhs) // { // this->_i1 = rhs._i1; // } // // return *this; // } // // void f() // { // std::cout << "_i1 = " << _i1 << std::endl; // std::cout << "_i2 = " << _i2 << std::endl; // } //private: // int _i1; // int& _i2; //}; // //int main() //{ // Foo of; // of.f(); // // return 0; //} // end 20100720

你可能感兴趣的:(c,Integer,iostream,2010)