c++ 用宏定义一个函数
c++ 用宏定义一个函数
C++‘s constructor is different than java or C#. A C++ constructor like any other function, has a name, a parameter list, and a function body. Unlike other functions, a C++ constructor may also contain a constructor initializer list: class ClassC{ public: ClassC():m_a(1),m_b(1.5){ // the constructor initializer list } private: int m_a; float m_b; }; The constructor initializer starts with a […]
Introduction We speak of a Vector as a container because it contains other objects. All objects in a container must have the same type. To use a Vector, we must include the appropriate header. #include <vector> Using std::vector; In the case of Vector, we must say what type of objects the Vector will contain. We specify the type by putting it between a pair of angle brackets followin […]