Daniel said:
Sorry.
unsigned int u = 0;
u is incremented in a loop.
I tried . . .
ls[0] = 1;
and . . .
ls[2] = 1;
they both give the same error.
OK, I understand that you are using System.Collection.Generic.List<T>
generic container from .NET, from a C++/CLI code I think.
The constructor to which you pass as integer sets list initial capacity,
not its size.
So the list is still empty from operator[] point of view.
I think you should fill the list with code like this:
<code>
List<int> ^ list = gcnew List<int>();
int count = 1000;
for ( int i = 0; i < count; i++ )
{
list->Add( i );
}
</code>
Giovanni