Python列表等价于C ++? [英] Python list equivalent in C++?
本文介绍了Python列表等价于C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你能告诉我什么是最接近的数据类型在C ++到python列表?如果没有类似的,你将如何在C ++中构建它?
Could you please tell me what is the closest data type in C++ to python list? If there is nothing similar, how would you build it in C++?
推荐答案
std :: vector
s, std :: list
和数组(或 std :: array
s)都有类似于Python列表的功能。您要选择的数据结构取决于您的要求。
std::vector
s, std::list
s, and arrays (or std::array
s) all have features similar to Python lists. Which data structure you want to choose depends on your requirements.
这篇关于Python列表等价于C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文