Discussion Outline - # 8
Week of 10/27 - 10/30
- General Questions
- Questions on Midterm - General questions only !!!
DO NOT GIVE ANSWERS FOR ANY OF THE MASTER QUESTIONS !!!
- The midterm is on Tuesday.
- Random Numbers
- Using rand() from stdlib
- Seeding the random number generator with srand()
- Same seed produces same set of numbers - great for debugging
- Seed using time() also from stdlib to guarantee a new seed each time.
- Global variables
- Explain scope of variables
- Globals have file scope
- Explain the HAZARDS of globals
- Do a trace to show how messed up things can get
- USE OF GLOBALS IS NOT ALLOWED IN ANY 201 PROJECT