Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

I don't know if there's a prettier way to do this, but you can create a new array and assign the elements from the old into the new.

[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.

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

  • Leaders
Posted

Oh, then just swap them at the end:

sectou = sector

:).

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...