• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Arrays > Array Creation and Manipulation

Array Creation and Manipulation

When you can see the benefits of arrays and you decide how to structure the data, you need to learn how to populate the array with the various values. After an array is created, you’ll need to learn how to manipulate its contents. Not only can you search and sort an array, but you also can add more items. This section covers how to create and manipulate arrays.

Creating and Populating Arrays

There are several ways to create a variable that contains an array. You can simply initialize a new variable as an array without contents, and populate the array later. Similarly, you can initialize an array of a specific dimension (that is, with a certain number of indexes available). Finally, by assigning a variable’s value to data that’s in the form of an array, you can create and populate an array in one move. We’ll look at all three ways to create arrays as well as how to add to an array already in existence.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint