Archive for the ‘C++基础’ Category

c++ 用宏定义一个函数

c++ 用宏定义一个函数


C++基础之全局变量 extern的使用

C++ 中的Virtual Function (虚函数)

来讲讲C++ virtual关键词的部分用法。

C++ Copy Constructor (拷贝构造函数,复制构造函数)


来谈谈C++ 位运算 & | > ^ ~ %

我们这次来谈谈一些奇怪的符号 & | << >> ^ ~ % ,他们当中的一些叫做位运算。

C++ 函数指针 函数名作为参数

函数指针声明例子 函数名作为参数

C++ 载入dll


C++ write constructors using a constructor initializer 构造函数 初始化数据

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 […]

STL Vector

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 […]

C++基础之 “内联函数”