Re: [ROOT] Adjustable array dimension

From: Radovan CHYTRACEK (Radovan.Chytracek@cern.ch)
Date: Fri Mar 09 2001 - 09:06:21 MET


"Valeri Fine (Faine)" wrote:
> 
> > Victor Perevoztchikov wrote:
> > >
> > > Hi Radovan,
> > >
> > > > > Int_t fun(const Int_t n, Int_t x) {
> > > > >    Int_t arr[n];
> > >
> > > such array is forbidden by C++. Even if CINT can handle
> > > it, it is better to avoid non C++ constructions
> >
> > Hi,
> >
> >            I know, but G++ can handle it as well, look:
> 
>     And what ?
> 
>                     Valeri
Nothing,

         I mean that this can be misleading people unless they use
-pedantic command line parameter to g++
which issues the following warning in this case:

test.C: In function `Int_t fun(Int_t, Int_t)':
test.C:19: warning: ANSI C++ forbids variable-size array `arr'

Radovan




This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:39 MET