D
Donald
I am trying print the length of a managed array, but I cannot figure out how
to correctly cast the result so String::Format will use it. I wrote a simple
test to duplicate the problem (below) -- can anybody explain to me why the
following generates an error?
int ai __gc[] = new int __gc[100];
Console::WriteLine(ai->Length);
Console::WriteLine(String::Format(S"Length of ai is {0}",
__box(ai->Length)));
The first Writeline returns the correct answer but the last line generates
an error of "Object reference not set to an instance of an object".
Thanks in advance,
don.
to correctly cast the result so String::Format will use it. I wrote a simple
test to duplicate the problem (below) -- can anybody explain to me why the
following generates an error?
int ai __gc[] = new int __gc[100];
Console::WriteLine(ai->Length);
Console::WriteLine(String::Format(S"Length of ai is {0}",
__box(ai->Length)));
The first Writeline returns the correct answer but the last line generates
an error of "Object reference not set to an instance of an object".
Thanks in advance,
don.