www.digitalmars.com         C & C++   DMDScript  

c++ - [BUG] Reference to array

reply Heinz Saathoff <hsaat bre.ipnet.de> writes:
Hi,

here is another bug for Walter to chase <g>

  int  Array[10][3];
  int main()
  {
     int (&ar)[3] = Array[2];
     ar[2] = 10;
     return 0;
  }//main

ar should be a reference to a onedimensional array of 3 ints. This works 
with MSVC and lint. Meanwhile I use the pointer method 
  int *ar=Array[2];


Regards,
   Heinz
Jun 27 2002
parent "Walter" <walter digitalmars.com> writes:
Ok, I got it! -Walter
Jul 01 2002