First of all, don't hard-code your 10, this makes the code completely unsupportable. Ever heard of constants? Do you understand that it could be a variable?
As to the code, it looks correct, but who knows what is
, where it is declared? You should not ask anything about some unknown part of the code. Believe or not, but because of late spring and massive snow melting, my access to your hard drive is somewhat limited. If you declare
correctly as an instance of
, your code will work correctly. Please see:
Should be something like
using namespace std;
Just for some fun, please see this CodeProject article: Arrays in C++/CLI