Hi Erik, You have to make it a pointer to a pointer **, Root has a TMatrix class that might be useful.... void Main () { Float_t SiPhi[6][42]; LoadPhiMap(SiPhi); for (Int_t i = 0; i<6; i++) { for (Int_t j = 0; j<42; j++) {cout<<SiPhi[i][j]<<endl;} } } void LoadPhiMap(Float_t **SiPhi) { } On Fri, 27 Aug 2004, Johnson, Erik B wrote: > Brahms, > I have an issue with c++ that I'm not sure how to handle. I have this in my code at the moment > void Main () > { > Float_t SiPhi[6]; > LoadPhiMap(SiPhi); > for (Int_t i = 0; i<6; i++) { cout<<SiPhi[i]<<endl;} > } > > void LoadPhiMap(Float_t *SiPhi) > { > > } > > which works fine. I get a print out of all the elements in SiPhi. But when I try > void Main () > { > Float_t SiPhi[6][42]; > LoadPhiMap(SiPhi); > for (Int_t i = 0; i<6; i++) { > for (Int_t j = 0; i<42; i++) {cout<<SiPhi[i]<<endl;} > } > } > > void LoadPhiMap(Float_t *SiPhi) > { > > } > I get this error > Error: Function LoadPhiMap(SiPhi) is not defined in current scope > Does anyone know how to handle 2d arrays in this situation? > Thanks, > Erik > > > > > _______________________________________________ > Brahms-dev-l mailing list > Brahms-dev-l@lists.bnl.gov > http://lists.bnl.gov/mailman/listinfo/brahms-dev-l > -- :-) --------------------------- )-: Peter H L Christiansen pchristi@nbi.dk / (+41)764870425 :-D --------------------------- \-: _______________________________________________ Brahms-dev-l mailing list Brahms-dev-l@lists.bnl.gov http://lists.bnl.gov/mailman/listinfo/brahms-dev-lReceived on Fri Aug 27 12:08:42 2004
This archive was generated by hypermail 2.1.8 : Fri Aug 27 2004 - 12:08:59 EDT