redimensioning

Keith_boys

New member
Joined
Apr 22, 2004
Messages
2
Does anyone know how to redimmension arrays in J#? im trying to translate from c to j and its not working. id appreciate any help. thanks.
 
I dont know if theres a prettier way to do this, but you can create a new array and assign the elements from the old into the new.
Code:
[COLOR=DarkSlateBlue]int[/COLOR] sectou[] = {10, 20, 30, 40, 50, 60};
[COLOR=DarkOrchid]// Old array above, new array below.[/COLOR]
[COLOR=DarkSlateBlue]int[/COLOR] sector[] = [COLOR=DarkSlateBlue]new int[/COLOR][7];
System.Array.Copy(sectou, 0, sector, 0, 6);
[COLOR=DarkOrchid]// Copies in the old elements.[/COLOR]
If you only want a bigger array, the new int[##] part should work for you.
 
its public

thanks for the suggestion, but the problem with that, is that the array im trying to redimension is public.
 
Back
Top