摘要:
1.List class MM { public: MM(string name, int age) :name(name), age(age) {} string getName() const{ return name; } int getAge() const{ return age; } p 阅读全文
摘要:
1.vector void testCreateVector() { vector<int> vi; //构造时没有标长度不能直接用下表法访问 //vi[0]=1; vi = { 1,2,3,4 }; vector<string> vs = { "Hello","Hi","loveyou" }; v 阅读全文
摘要:
1.array myArray.hpp //定义和实现写在一起的时候,用hpp #include <iostream> using namespace std; template <class T, size_t _size> class MyArray { public: MyArray() { 阅读全文