随笔分类 - c++面向对象
摘要:#include <iostream> using namespace std; template <typename T>//通用类模板,模拟了栈并未真正实现 class Stack{ public: Stack();//构造函数 ~Stack();//析构函数 void push(T t);//
阅读全文
摘要:1 #include <iostream> 2 #include <fstream> 3 using namespace std; 4 5 6 ifstream fin("sum.in");//填入文件的地址 7 ofstream fout("sum.out"); 8 9 int main() {
阅读全文
摘要:1. 作为写了几道算法题的人都知道,const和内置或自定义类型一起声明时,表示的是常量不可改变。 比如像下面这样。 const int N = 122222; 2. 在此const和成员函数声明结合到一起表示的是什么.同时也是引入this, 就相当于this->bookNo 看下面这代码 假设bo
阅读全文
浙公网安备 33010602011771号