Learn about arrays, their limitations, and how to code them in this video.
- [Instructor] You may have noticed…on our previous test runs of our program…that the name field is suspiciously empty.…I'm going to click the play button…and as you can see, I get all of my scores…but there's no way to get a character name in here.…I really want this program…to be a one stop shop.…I want to be able to roll a character…and immediately start playing my game.…So I'm going to close down my terminal window…and I'm going to go back into Visual Studio…and I'm going to add a functionality in here…that allows us to randomly generate a name.…
This affords me the opportunity…to show you how to use arrays in your C Sharp programs.…Arrays are really just lists of common items.…So let me show you what I mean.…I'm going to go back up to the top…where the constructor is…and I'm actually going to add a new member variable in here.…I'm going to put mine right above where I declare my random.…And this new property is going to be private.…It's going to be an array of strings.…
So to make an array of strings,…we just type string and then we use square braces.…
AuthorBruce Van Horn
- Exploring C# on a Mac
- Creating a reusable code library
- Classes and properties
- Loops, arrays, and lists
- Creating a console app
- Creating a command-line app
- Creating a Mac desktop app
- Creating a UI with view controllers and actions
Skill Level Beginner
1. C# on the Mac?
2. Getting Started with C#
3. Deeper into C#
4. Creating a Mac App
Next steps3m 14s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.