![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
stl
文章平均质量分 54
三丰杂货铺
这个作者很懒,什么都没留下…
展开
-
c++ - This指针
一般情况下,不用This指针,而是加后缀suffix_来表示某变量是类内部变量. #include <iostream> class myclass { public: myclass(int i) { i_ = i; } int getval() { return i_; } private: int i_; }; int main() { auto mc = myclass{1}; std::cout << mc.getval() << "\n"; } 改变后: #原创 2021-08-13 11:52:27 · 65 阅读 · 0 评论 -
C++ - STL
文章目录c++style 迭代vectormap迭代器流迭代器(按空格读取文件的数据) 容器分为顺序容器(没排序,按顺序放的)还有Ordered Containers c++style 迭代 #include <array> #include <iostream> int main() { // C-style. Don't do this // int ages[3] = { 18, 19, 20 }; // for (int i = 0; i < 3; ++i) { //原创 2021-08-12 16:15:52 · 248 阅读 · 0 评论