C ++中是否有鏈接列表預定義庫? - Is there a linked list predefined library in C++? -开发者知识库

Is there a linked list in C that I could just #include? Or do I need to create my own if I want to use one?

C 中是否有鏈接列表,我可以#include?或者,如果我想使用它,我是否需要創建自己的?

5 个解决方案

#1


35  

As daniel notes, yes, std::list. Usage would be:

正如daniel所說,是的,std :: list。用法是:

#include <list>
// ...
std::list<int> listOfInts;
listOfInts.push_back(1);
// ...

And so on.

等等。

You can find a complete list of STL classes here. The section you're after is 3.2, Container classes. Another useful reference of the C Standard Library is here.

您可以在此處找到完整的STL課程列表。您所追求的部分是3.2,容器類。這里是C 標准庫的另一個有用的參考。

最佳答案:

本文经用户投稿或网站收集转载,如有侵权请联系本站。

发表评论

0条回复