STL容器 [英] STL Container

查看:73
本文介绍了STL容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我是c ++的新手。我想创建一个插入,搜索和显示数据的简单应用程序。我打算使用STL容器。


我将使用什么样的STL容器来存储3种不同的数据类型?

例如:int ,bool,double

谢谢

解决方案

lourk,


你应该查看下面的网址。

http://www.cplusplus.com/reference/stl/


如果您有任何疑问,我们可以帮助您..


没有允许多种类型的标准容器。尝试使用Boost或尝试使用变体或作为最后的手段使用union


,或者您可以使用具有以下三种类型的类:

展开 | 选择 | Wrap | 行号

Hello Everybody!

I am a newbie in c++. I want to create a simple application that insert, search and displays data. And I am planning to use an STL Container.

What kind of STL Container am I going to use that stores 3 different data types?
example: int, bool, double

Thank you

解决方案

lourk,

you should look over url below.

http://www.cplusplus.com/reference/stl/

After that if you have any question, we can help u..


There are no Standard containers that allow multiple types. Try Boost or try using a variant or as a last resort a union


or you could just use class with the three types:

Expand|Select|Wrap|Line Numbers


这篇关于STL容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆