Search code examples
arraysc++-climanaged

managed array or array of managed objects in Visual C++/CLI


For a practice PacMan

array<bool>^ aEtats;             //declared: an array of true/false states

aEtats = gcnew array<bool>(100); //this array will correspond with an array of "Pills"

for each (bool b in aEtats)  
     b=true;

I get an array of 100 "false". Why ?


Solution

  • Or just change the for each loop to use a reference, e.g. for each (bool% b in aEats). – Ben Voigt