gpt4 book ai didi

c++ - 如何在 C++ 中使用 STL 列表创建循环

转载 作者:行者123 更新时间:2023-11-28 00:55:05 26 4
gpt4 key购买 nike

这是一道面试题:How to create a loop using the STL list container?

我是新手。我搜索了这个问题,但没有找到。如果这是一个老问题,请给我链接并删除这篇文章。

谢谢大家!

最佳答案

How to create a loop using the STL list container?

你不能。

std::list 有开始和结束。对数据结构的所有访问都受到仔细控制,因此符合标准的程序根本无法生成非终止列表。

P.s. 我假设面试官实际上是想说“std::list”而不是“STL list”。

关于c++ - 如何在 C++ 中使用 STL 列表创建循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11905316/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com