0% found this document useful (0 votes)
27 views2 pages

Getting Started: 1. Compiler Errors

The document outlines various types of errors encountered in programming, including compiler errors (syntax and semantic), compiler warnings, linker errors, runtime errors, and logic errors. It emphasizes the importance of addressing compiler warnings and highlights that some errors may not prevent compilation but can lead to issues during execution. Additionally, it discusses how runtime errors can cause program crashes and the role of exception handling in managing these errors.

Uploaded by

Ng Jian Long
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Getting Started: 1. Compiler Errors

The document outlines various types of errors encountered in programming, including compiler errors (syntax and semantic), compiler warnings, linker errors, runtime errors, and logic errors. It emphasizes the importance of addressing compiler warnings and highlights that some errors may not prevent compilation but can lead to issues during execution. Additionally, it discusses how runtime errors can cause program crashes and the role of exception handling in managing these errors.

Uploaded by

Ng Jian Long
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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