Difference between syntax and symantuc errors in computer c++
Answers
Answered by
1
There are basically three (3) types of programming errors.
1) Syntax errors. These are invalid code the compiler doesn't understand, e.g. your example of multiplying a string with an integer in C. The compiler will detect them, because it can't compile them.
2) Semantic errors. These are valid code the compiler understands, but they do not what you, the programmer, intended. These may be using the wrong variable, the wrong operation, or operations in the wrong order. There is no way for the compiler to detect them.
There is a third class, which can be the most expensive:
3) Design errors. The code is correct and bug-free and does exactly what you've intended. But your intentions are wrong, e.g. based on wrong assumptions, wrong models, or you've used the wrong formulas, misunderstood the customer, or such.
Similar questions