C++
digta
这个作者很懒,什么都没留下…
展开
-
二叉搜索树的C++实现
尚未写完,删除没写#ifndef BINARYTREE_H #define BINARYTREE_H #include namespace binaryTree{ template class btNode { public: btNode(); inline btNode(const T& value) :val(value){} ~btNode(); btNod原创 2016-08-26 17:10:20 · 397 阅读 · 0 评论 -
求0,1图像中4邻域数量
#include #include using namespace std; bool inMatrix(int x, int y, int rows, int cols) { if (x = 0 && y >= 0 && y <= cols) return true; else return false; } void printMatrix(int* matrix, in原创 2016-09-13 21:45:39 · 1066 阅读 · 0 评论 -
二刷 C++ Primer 要点整理 Chapter 7.
C++ Primer 要点整理 Chapter 7. this this的类型是 ExampleClass * const,所以不能将this绑定到常量对象上。所以也就不能在常量对象上调用普通成员函数。 ExampleClass::Func(&Obj, other params…);编译器眼中对成员函数的调用。 const成员函数 上一条提到this的默认类型是 ExampleClass原创 2018-02-04 23:57:25 · 156 阅读 · 0 评论 -
二刷 C++ Primer 要点整理 Chapter 7.
C++ Primer 要点整理 Chapter 7. this this的类型是 ExampleClass * const,所以不能将this绑定到常量对象上。所以也就不能在常量对象上调用普通成员函数。 ExampleClass::Func(&Obj, other params…);编译器眼中对成员函数的调用。 const成员函数 上一条提到this的默认类型是 Exa...原创 2018-02-09 21:38:55 · 130 阅读 · 0 评论 -
二刷 C++ Primer 要点整理 Chapter 6.
C++ Primer 要点整理 Chapter 6. 函数内局部静态对象 static 局部对象生命期直到程序终止 size_t count_calls() { static size_t ctr = 0;//调用结束后仍有效 return ++ctr; } 数组引用形参 f(int &arr[10]) //首先是数组,再是引用的数组 f(int (&arr)[1原创 2018-01-31 23:03:50 · 175 阅读 · 0 评论