Re: [ROOT] String Array

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Oct 04 2000 - 12:27:14 MEST


Hi Roland,
You have something wrong in your declaration.
Use one of the two forms:
  Char_t Names[20][80];
  Char_t *Names[20];

Rene Brun

Roland Bramm wrote:
> 
> Hi Rooters
> 
> i've a small problem concerning making a two Dimensional Array of Strings.
> 
> On the old Version (Root49 < 2.25.03)
> this Worked
> 
> Char_t *Names[20][80];
> 
> Names[1][] = "The Filled Text"; // Sometimes this is filled more than
> one time !
> 
> for(Int_t j = 0; j<19;j++){
>         cout << Names[j]  << endl;
> }
> 
> But now i get after the first Run a MEssage:
>   Error: Array index out of range  -> [1356320512]  valid upto Names[19][79]
> 
> This happens after filling Names some times.
> 
> Is there a solution ?
> Or is it possible to make a Array of Strings ( from TSring) ?
> 
> Cheers



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:34 MET