Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

separate an array into sub-arrays, PLEASE help!

luanzhuluanzhu Member Posts: 1
[b][red]This message was edited by luanzhu at 2003-10-24 22:15:46[/red][/b][hr]
[b][red]This message was edited by luanzhu at 2003-10-24 21:29:9[/red][/b][hr]
If I have an array like

int[] m = new int[] { 0, 1, 2, 3 },

is there a way I can seperate the array into two, like

int[] m01 = somefunction?(m,0,2) // m01 will hold 1st and 2nd items in array m
int[] m23 = somefunction?(m,2,2) // m23 will hold srd and 4th items in array m

and m01's address should be same as m's, m23's address should be same as that of the 3rd
item in the original array m?

In another words, what I want to do is to seperate the array into sub-arrays, and the sub-arrays should reference the same items in the original array.

Any idea will be appreciated!


Thanks,
Zhu


Sign In or Register to comment.