Finding bugs is a huge part of a programmer’s life. Don’t be intimidated by them… embrace them. Errors in your code mean you’re trying to do something cool!
In this lesson, we have learned about the four types of C++ errors:
- Compile-time errors: Errors found by the compiler.
- Link-time errors: Errors found by the linker when it is trying to combine object files into an executable program.
- Run-time errors: Errors found by checks in a running program.
- Logic errors: Errors found by the programmer looking for the causes of erroneous results.
Remember, Google and Stack Overflow are a programmer’s best friends. For some more motivation, check out this blog post: Thinking About Errors in Your Code Differently.
We wish you the best of luck in your bug-squashing journey.
Instructions
Optional: Because your friend didn’t debug along the way, they ended up with a super buggy program. Can you be a bug detective and help them debug their program?
The final program should print a fortune message like:
🥠 Flattery will go far tonight.
Final tip: If you encounter a long error message, always scroll to the top and try to debug the very first bug.