Discussion Outline- Week 10
- General Questions
- 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