I've got this code (Simplified example) in my Visual Studio 10:
int myfunc(void)
{
array <int^>^ temparr=gcnew array<int^>(11);
for (int i=0; i<11; i++)
{
temparr[i]=0;
}
temparr[2]=1; //one of the elements is 1
for (int i=0; i<11; i++)
{
if (!temparr[i]) return 0;
}
return 1;
}
But when I use this function the output is 1 rather than 0. What can be the problem and how to correct this code?