yeah, that works if i create my own class like you just did... the
problem is that im trying to use the chartfx for .net, so i havn't
defined the class by my self... i can not find anything about using
chartfx in vc on the web... I dont know if it is the compiler which is
buggy?
It works perfect in C#, but i have some native c++ code which i need to
reuse... maybe to much to ask, but could you tell me what to do ;)
Thanks agian for your help Martin :)
mphanke wrote:
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;
}
TJH wrote:
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 :)
mphanke wrote:
Hi,
I guess waht you want to do is:
some_object->array->Item[i] = 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[i] = something;
Thanks :) Toke Jansen