Reputation: 2546
array<int,2>^ a = gcnew array<int,2>(5,5);
for(int i=0; i<5; i++)
{
for(int j=0; j<5; j++)
{
a[i][j] = 0;
}
}
The above code is giving me the following two errors:
Error 1 error C3262: invalid array indexing: 1 dimension(s) specified for 2-dimensional 'cli::array ^'
Error 2 error C2109: subscript requires array or pointer type
Why is it so? :(
Upvotes: 1
Views: 1544
Reputation: 2546
Found the solution!
Instead of using:
a[i][j] = 0;
It should be like this:
a[i,j] = 0;
Upvotes: 3