My code isn’t working! What do I do?
Answer 1: Think about the code you have written. Why might it fail to produce the right
result? Modify code as needed.
Answer 2: Debug it.
Visual Studio is a powerful IDE with professional debugging tools.
- Make sure your program is in Debug
- Set breakpoints (F9) to stop
execution at specific places
- Run the program. When it breaks,
- Look at values in variables
- Use F10 and F11 to step over / step
- Use F5 to resume the program