随笔分类 -  C++

摘要:1. 迭代器简介 为了提高C++编程的效率,STL(Standard Template Library)中提供了许多容器,包括vector、list、map、set等。然而有些容器(vector)可以通过下标索引的方式访问容器里面的数据,但是大部分的容器(list、map、set)不能使用这种方式访 阅读全文
posted @ 2020-03-14 20:37 wengle 阅读(13293) 评论(0) 推荐(1) 编辑
摘要:本文主要介绍const修饰符在C++中的主要用法,下面会从两个方面进行介绍: 类定义中使用const 、 非类定义中使用const 1. 非类定义中使用const 非类定义中使用const是指:在除了类定义以外的场景中使用const。 1.1 变量 顶层const:变量本身是个常量 底层const: 阅读全文
posted @ 2020-03-10 20:56 wengle 阅读(692) 评论(3) 推荐(0) 编辑
摘要:1. 问题代码 C++ bool find_int(const std::vector::iterator &begin, const std::vector::iterator &end, int v) C++ bool find_int(std::vector::iterator begin, 阅读全文
posted @ 2020-03-09 17:43 wengle 阅读(1947) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示