STL [英] STL

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

问题描述




以下代码是什么意思?它是一个二维向量?


#include< vector> ;;


向量< vector< int vv;


谢谢,

Michael

Hi,

What does the following code mean? It''s a two-dimensional vector?

#include <vector>;

vector<vector<int vv;

Thanks,
Michael

推荐答案



迈克尔 < mi ******* @ gmail.comskrev i meddelandet

news:11 ********************* @ b28g2000cwb .googlegro ups.com ...

"Michael" <mi*******@gmail.comskrev i meddelandet
news:11*********************@b28g2000cwb.googlegro ups.com...




以下代码是什么意思?这是一个二维向量?
Hi,

What does the following code mean? It''s a two-dimensional vector?



排序。它是一个整数向量的向量。


内部向量可以有不同的大小,所以它不是立即

a矩阵。

Bo Persson

Sort of. It is a vector of vectors of integers.

The inner vectors can be of different sizes, so it is not immediately
a matrix.
Bo Persson


>

#include< vector>;


vector< vector< int vv;


谢谢,

Michael
>
#include <vector>;

vector<vector<int vv;

Thanks,
Michael



Michael写道:
Michael wrote:

以下代码是什么意思?它是一个二维向量?


#include< vector> ;;
What does the following code mean? It''s a two-dimensional vector?

#include <vector>;



删除分号。添加:using namespace std;

Delete the semicolon. Add: using namespace std;


>

vector< vector< int vv;
>
vector<vector<int vv;



是的,一个二维向量 - 即向量向量。


干杯! --M

Yes, a two-dimensional vector -- i.e., a vector of vectors.

Cheers! --M


mlimber写道:
mlimber wrote:

> ; vector< vector< int vv;
>vector<vector<int vv;



是的,二维向量 - 即向量向量。


Yes, a two-dimensional vector -- i.e., a vector of vectors.



AKA aragged array;在稀疏矩阵之间的中间。一个矩阵。


BTW有没有人一般会担心深拷贝的成本,因为这样一个

数组会被填充?

-

Phlip
http://c2.com/cgi/wiki?ZeekLand < - 不是博客!!!

AKA a "ragged array"; halfway between a "sparse matrix" and a matrix.

BTW does anyone generally worry about the cost of deep-copies as such an
array gets populated?

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


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

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