Chapter 1
Structures and Arrays
IN THIS CHAPTER
Using structures to store and retrieve data
Creating and working with arrays
Using resizable arrays
Running multidimensional arrays
Combining structures with arrays
Detailing the drawbacks of arrays
All programs need to store data. If a program asks the user to type in their name, the program needs to store that name somewhere so it can find the name again. The most common way programs store data is to dump data in a variable.
Unfortunately, a simple variable can hold only one chunk of data at a time, such as a single number or a single name. If you want to store a person’s first and last name along with their age, you have to create three separate variables, like this:
Dim FirstName As StringDim LastName As StringDim Age As Integer
Creating separate variables to store related data can be like carrying around three separate wallets ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access