Those that occur during translation of the code before it runs
<aside>
❓ Would it make it through the stages of compilation?
</aside>
- The instructions given cannot be translated to machine code due to errors.
- Formatting error
- Trying to divide by piece a string
Syntax errors
- An error that occurs when a command does not follow the expected syntax of the language
Linking errors
- Occurs when a programmer calls a function within a program and the correct library has not been linked to that program
- When the square root function is used and the library that calculates the square root has not been linked to the program
Semantic errors
- Variable declared illegally
Execution/runtime errors
Those that occur while the program is running but after translation
<aside>
💡 Even though a program will compile and execute it could unexpectedly crash or produce incorrect results.
</aside>
Examples
- Divide by zero
- Reading past the end of file
- Stack overflow/request more memory than available