You are on page 1of 2

Getting Started

1. Compiler Errors
- Programming language has rules to be strictly follow
- Compilers are picky
- Compilers translate codes written into machine code that function as written
- Compiler will not guess the meaning of the code, it will generate an error if it
doesn’t understands it
- Include:
a. Syntax Errors
- Something wrong with the structure
 Forgot ;
 Accidentally left out”
 Wrongly spelt namespace
b. Semantic Errors
- Syntax is correct but the meaning of the code doesn’t makes sense to the
compiler
 a + b if at least one of a and b is not integer
 Perform mathematical operations on strings
2. Compiler Warnings
- DO NOT IGNORE COMPILER WARNINGS!!!
- The compiler has recognized an issue with your code that could lead to potential
problems
- Remained as warning instead of error because the compiler is still able to
understand the code and produce object codes from it

* miles_driven is not initialized


- Syntactically not wrong but may lead to problems if not treated
3. Linker Errors
- Occurred when linker is having trouble linking all object files together to create an
executable program
- Usually occurs when there is a library or object file missing
- Sometimes due to path error
- NOTHING WRONG WITH THE SYNTAX AND CAN BE COMPILE!
4. Runtime Errors
- Errors that occur when the program is executing
- Division by 0
- File not found
- Out of memory
- Difficult to predict when writing the program
- May cause program to crash
- Exception Handling is used to let us know when it happens
5. Logic Errors
- Errors or bugs in code that cause the program to run incorrectly
- Mistakes made by programmers
- NOTHING WRONG WITH THE SYNTAX AND CAN BE COMPILE!

You might also like