Re: multidimensional arrays (vector)
From: Chris Mantoulidis (cmad_x_at_yahoo.com)
Date: 12/07/03
- Next message: osmium: "Re: I'm a stupid blond :( Please help me!!!"
- Previous message: Peter van Merkerk: "Re: I'm a stupid blond :( Please help me!!!"
- In reply to: Peter L.: "multidimensional arrays (vector)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Dec 2003 11:19:42 -0800
> I create a multidimensional array:
>
> vector< vector<string> > applications;
>
> and then I want to write into it.
You don't say how many items it will have. Since I haven't really
experimented with multidimensional vectors, I will give you a
onedimensional vector example:
vector<int> abc(20);
which creates 20 items. Do NOT confuse (20) with [20] because [20]
will create 20 empty vectors and you will get many error messages.
> applications[0][0] = "Test";
>
> Why do I get an segmentation fault error?
> I also tried to resize the array before, but
> it doesn't work.
Well, a possible reason would be because it doesn't know string size
so that i can be resized. But since I am not sure, it might not be
that.
- Next message: osmium: "Re: I'm a stupid blond :( Please help me!!!"
- Previous message: Peter van Merkerk: "Re: I'm a stupid blond :( Please help me!!!"
- In reply to: Peter L.: "multidimensional arrays (vector)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|