ERRORS and It's Types
Error are the most important term in programing...
Every beginner as well as professional programmer should face the problem of errors.
There error can be defined as
" Error is not getting a genuine result due to mistaken instruction. "
Or
" These are the simple mistakes which leads to not getting correct results or may be program will not execute "
In Book or in Internet you can find out many types of errors but all errors are similar to or slightly different from each other...
but there are only THREE TYPES OF BASIC ERRORS i.e,
1- Syntax Error / Compile Time Error
2- Run Time Error
3- Logical Error / Semantic Error
Syntax Error -
- These are the errors, when grammatical rule of C++ (any language) is not followed.
- There errors are shown at the time of compilation.
- It is also called Compile time error.
Eg- Syntax of for loop
for ( ; ; )
{
} // this is correct
{
} // this is incorrect
Run Time Error -
- These are the errors which occur at the time of program execution.
- These errors are shown at the time of execution.
Eg- a) Dividing by zero
b) Type mismatch
Login Error -
- These error occur when logic is incorrect but syntactically the statement is correct.
- It is also called Symmetric errors.
- Login error can't be seen , it leads to wrong result.
Eg- both are correct
if(x==y) // compare the value of x and y.
if(x=y) // value of y copies to x.
Comments
Post a Comment