Hi,
this snippet works for me (console hack for you):
[BTW: Have you initialized the Array?]
public __gc class testClass
{
public:
int Value[,];
testClass()
{
Value = new int __gc [10,10];
}
};
int _tmain()
{
// TODO: Please replace the sample code below with your own.
Console::WriteLine(S"Hello World");
testClass *tc = new testClass();
for(int i=0; i<10; i++)
for(int j=0; j<10; j++)
tc->Value[i,j] = rand();
for(int i=0; i<10; i++)
for(int j=0; j<10; j++)
Console::WriteLine(String::Format("Value[{0:00},{1:00}]={2}", __box(i),
__box(j), __box(tc->Value[i,j])));
Console::Read();
return 0;
}
Thanks Martin
That works, but only for 1D arrays, what about 2D. The Item function
only takes 1 argument...
what im trying to do is this: chart1->Value[0,0] = 30;
Thanks agian
Hi,
I guess waht you want to do is:
some_object->array->Item
= something;
Actually I expected the otherthing to work to, but for some reason it
didn't for me. But the above works.
This should help,
Martin
TJH wrote:
hi there
im new to develop in .net, and i keep getting this compiler error
"cannot perform pointer arithmetic on __gc pointer" when i try:
some_object->array = something;
Thanks Toke Jansen