Re: multidimensional arrays (vector)

From: Chris Mantoulidis (cmad_x_at_yahoo.com)
Date: 12/07/03


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.



Relevant Pages

  • Re: Array.copy
    ... I seen your example but I was trying to resize a multidimensional array. ... "Arne Vajhøj" wrote in message ... foreach(int iv in ia2) ...
    (microsoft.public.dotnet.languages.csharp)
  • multidimensional arrays (vector)
    ... It would be great if someone could give me a hint ... I create a multidimensional array: ... I also tried to resize the array before, ... Thank you very much for your response. ...
    (comp.lang.cpp)
  • How to pass a Function returning an array as a parameter
    ... If a have a function which returns a multidimensional array. ... Function CreateAnArray() ... Sub UseOneArrayas String) ...
    (microsoft.public.word.vba.beginners)