Join Dan Gookin for an in-depth discussion in this video Challenge: Lotto simulation, part of C: Data Structures, Pointers, and File Systems.
(techno music) … - [Instructor] Thanks to your C programming skills, … you no longer need to find your winning lotto numbers … inside a fortune cookie. … Your challenge is to write your own … lotto number drawing program. … This code has four parts. … First comes initialization, … second, pulling the lotto numbers, … third, sort the winning numbers lowest to highest, … and fourth, display the results. … Now, for the details. … Set the number of lotto balls to 51. … This value indicates the range of numbers from one to 51. … Set the number of balls to draw at six, … so the winning numbers will be in the range of one to 51, … and there will be six of them. … Here are some hints to help you. … Devise a way to keep track of the lotto numbers drawn. … That way, you don't accidentally draw … the same number multiple times. … Your solution will probably involve one or more arrays. … While you can use pointers … to help keep track of the numbers, it's not necessary. … I recommend setting constant expressions …
- Working with arrays
- Building a structure
- Creating an array of structures
- Testing characters
- Working with strings in C
- Using pointers to manipulate data
- Manipulating files
- Using command-line arguments
- Working with time functions
Skill Level Intermediate
1. Arrays and Structures
2. Characters and Strings
4. Files and the Operating System
5. The Interesting and Extraordinary
Next steps1m 52s
- 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.