freeCodeCamp/guide/chinese/cplusplus/lists/index.md

13 lines
872 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: C++ Lists
localeTitle: C ++列表
---
# 什么是STL清单
C ++中的列表是一个功能强大的工具类似于其众所周知的堂兄C ++ Vectors。而Vectors是一个顺序容器 如果元素在连续链中被索引,则列表也是一个顺序容器,但它们的组织方式不同。 List元素指向其下一个元素因此所有元素按顺序排序但它们不使用索引。 怎么样?你可能会问。他们这样做不是通过索引,而是使用一个称为迭代器的特殊工具。迭代器就像特殊指针一样 他的工作是保持列表元素的顺序,就像两辆火车车厢之间的联系。这是一个很好的视觉效果 与矢量和数组相比如何组织列表。 ![IMG](https://imgur.com/SiU8uTe.png)
## 如何声明一个List
如果要声明您编写的数字列表:
'''的std ::名单数;“””