摘要: 迭代器 迭代器 (iterator) 是 C++ 程序中常用的一种设计模式,它最重要的作用是为访问容器提供了统一的接口。 C++ STL 有许多容器,例如 vector、list、deque、map、unordered_map 。 而我们常常对不同的容器有相同的操作,比如在容器中查找一个元素、找出满 阅读全文
posted @ 2020-11-05 17:51 朱果果 阅读(423) 评论(0) 推荐(0)
摘要: 看一个例子: 1 #include <iostream> 2 3 using namespace std; 4 5 #define LEN 10 6 7 int len_foo() { 8 return 5; 9 } 10 11 int main() { 12 char arr_1[10]; 13 阅读全文
posted @ 2020-11-05 16:39 朱果果 阅读(833) 评论(0) 推荐(0)