G
Guest
hello
i am porting a program from C++ to C#
there are many read/writes of contigous regions in there
and i would like to save code
so 1st question is there a ready guide to problems with C++ translations
next, i would like to know whether there is a similar facility in C#
in c++/c i could take a pointer to an int and make it point anywhere
i could take address of any int, and could use it as pointer
e.g.
int x[200]
int* p_tens_of_ints
for (int i=0;i<20;i++){// i go by tens..
p_tens_sof_ints = x+i*(sizeof(int)*10)
for (int j=0;j<10;j++)
// use p_tens_of_ints as if it were a 20 members array
p_tens_of_ints[j]=20; // i could as well read it, nevermind
is there a way i could play with ref int[] the same way
if not what are the alternatives
note: i am on a compact framework, so i could not find a way of working with heapalloc etc
but maybe i am missing something.
anyway, in the case this has been documented somewhere, please be kind an point me to the direction
Thanks in advance
Max.
i am porting a program from C++ to C#
there are many read/writes of contigous regions in there
and i would like to save code
so 1st question is there a ready guide to problems with C++ translations
next, i would like to know whether there is a similar facility in C#
in c++/c i could take a pointer to an int and make it point anywhere
i could take address of any int, and could use it as pointer
e.g.
int x[200]
int* p_tens_of_ints
for (int i=0;i<20;i++){// i go by tens..
p_tens_sof_ints = x+i*(sizeof(int)*10)
for (int j=0;j<10;j++)
// use p_tens_of_ints as if it were a 20 members array
p_tens_of_ints[j]=20; // i could as well read it, nevermind
is there a way i could play with ref int[] the same way
if not what are the alternatives
note: i am on a compact framework, so i could not find a way of working with heapalloc etc
but maybe i am missing something.
anyway, in the case this has been documented somewhere, please be kind an point me to the direction
Thanks in advance
Max.