Logical Errors in C++ language :
These types of errors depend on the logical thinking of the programmer during programming and are easy to detect if we follow the line of execution.
Listed below are some common programming errors:
1. Commonly using ">" for ">>" and "<" for "<<".
2. Directly access the private variables of a class in main program.
3. Using switch statements without break.
4. Wrong usage of postfix and prefix operator in a program.
5. Using undeclared and uninitialized variables and functions in your program.
6. Include incorrect header files in your program.
7. Marking a member function as const in the class definition but not in the member function implementation.
8. Trying to return a value in a void function in your program.
9. Confusing the name of an array with the contents of the first element.
10. Using "=" instead of "= =" (comparison operators).
11. Trying to divide a number by Zero.
12. Not using string functions and treating the strings are integer .
13. C type string not terminated by '\0'- Null character.
14. Mismatched "{" or IF-ELSE statements or for that matter any looping statement.
15. using namespace std errors.
Thanks
Mukesh Rajput
These types of errors depend on the logical thinking of the programmer during programming and are easy to detect if we follow the line of execution.
Listed below are some common programming errors:
1. Commonly using ">" for ">>" and "<" for "<<".
2. Directly access the private variables of a class in main program.
3. Using switch statements without break.
4. Wrong usage of postfix and prefix operator in a program.
5. Using undeclared and uninitialized variables and functions in your program.
6. Include incorrect header files in your program.
7. Marking a member function as const in the class definition but not in the member function implementation.
8. Trying to return a value in a void function in your program.
9. Confusing the name of an array with the contents of the first element.
10. Using "=" instead of "= =" (comparison operators).
11. Trying to divide a number by Zero.
12. Not using string functions and treating the strings are integer .
13. C type string not terminated by '\0'- Null character.
14. Mismatched "{" or IF-ELSE statements or for that matter any looping statement.
15. using namespace std errors.
Thanks
Mukesh Rajput
Post A Comment:
0 comments: