Tuesday, May 19, 2009

Types of Error

Types of Error

1. Compile Time Error
2. Link Time Error (Linking Error)
3. Run Time Error (Exception)

Compile Time Error
Compiler is a program that analyzes the program syntactically and semantically and converts in object code (binary form) in form of object file.

Source code -> Compiler -> Object Code

Compile time error may occur for any number of reasons, usually they are result of typo or other inadvertent error.
Some compiler not only tell you what you did wrong but also point out the wrong statement. And some intelligent compiler also suggests remedy.

Some reasons of Compile Time Error:
  • Statement is syntactically or semantically incorrect.
  • Due to unrecognized character
  • Misspelled keyword

Link Time Error (Linking Error)
After creating an object file, compiler invokes a linker which converts the object file into executable program.

In this steps number or libraries are to be linked to make an executable program. When errors are produce in this step they are called Linking Errors.

They are usually produced when the program is not able to find the required library to execute the program.

Run Time Error (Exception)
Errors that are occurred while the program is running / executing, these type of error are produce because of incorrect logic or some undetermined situation.

They are very dangerous and kill the program. So you need to handle these types of errors very carefully.

So it is advisable to use exception handling mechanism for the statement(s) which is supposed to generate an exception.

No comments:

Post a Comment