Join Dan Gookin for an in-depth discussion in this video Solution: Add a dimension to an array, part of Learning C (2014).
- Here's how I'd make the change.…First, add the string after "Pluto".…So add a comma, and type "Pinocchio".…No comma after "Pinocchio".…Plus you have to re-dimension the array.…It now has five strings,…five elements in the first direction.…And "Pinocchio" itself is nine characters long,…so you're gonna need 10 characters in the grid…to handle that null character at the end of the string.…So that's the news dimensions: five, ten.…
"Pinocchio" added at the bottom.…And remember to modify the for loop…so that it loops five times instead of four.…Save, build, and run.…
- Understanding a C program
- Adding comments
- Using escape characters
- Working with values and placeholders
- Introducing variables
- Making a decision with if
- Adding functions
- Manipulating strings
- Building arrays
- Nesting structures
Skill Level Beginner
1. Getting Started
2. Programming Basics
3. Program Flow Control
4. Intermediate C Language Concepts
5. Advanced C Language Concepts
Next steps2m 11s
- 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.