Re: [ROOT] How to pass two-dimensional array

From: cstrato (cstrato@aon.at)
Date: Sat Nov 30 2002 - 22:22:43 MET


Dear Brett

Thank you for your fast reply, now my code works.

Best regards
Christian


Brett Viren wrote:

> cstrato writes:
>  > In MyMethod() I have created a two-dimensional array:
>  > void  MyMethod(Int_t ncols, Int_t nrows)
>  > {
>  >     Double_t **table = 0;
>  >     table = new Double_t*[ncols];
>  >     for (Int_t i=0; i<ncols; i++) {
>  >        table[i] = new Double_t[nrows];
>  >     }
>  >  >     // fill table with data before calling:
>  >     DrawTable(nrows, ncols, table, opt); //<==compile error
>  > }
>  >  > The function DrawTable() looks as follwos:
>  > void  DrawTable(Int_t n, Int_t m, Double_t &table, Option_t *opt)
>  > // write: Double_t &table  or: Double_t **table ??)
> 
> Pass as "Double_t **table".
> 
> -Brett.
> 
> 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:22 MET