Back to Course

Introduction to C++

0% Complete
0/0 Steps
  1. C++: Basics
    5Topics
    |
    6 Quizzes
  2. C++: Compilation and Execution
    5Topics
    |
    6 Quizzes
  3. C++: Variables
    9Topics
    |
    10 Quizzes
  4. C++: Conditions Operators
    5Topics
    |
    6 Quizzes
  5. C++: Logical Operators
    3Topics
    |
    4 Quizzes
  6. C++: Loops and Errors
    8Topics
    |
    9 Quizzes
  7. C++: Vectors
    4Topics
    |
    3 Quizzes
Lesson 6, Topic 8
In Progress

C++: Logical Errors

Yasin Cakal 20 Nov 2021
Lesson Progress
0% Complete

After compilation, linking, and run-time errors are removed, the programs can be executed without fail. But there might be times when the program you’re trying to run doesn’t give the result you’re expecting it to give.

There is also a possibility that no output is given when you execute a program. Such errors are called logical errors. These programs are error-free, but the code you type doesn’t execute correctly or could be some other problem.

Such errors are the most difficult to indicate and solve as they are not indicated by the compiler, linker, or anything else. These errors are called logical errors because they occur due to the programmer’s faulty ‘logical’ thinking.

Let’s go through some examples of logical errors:

  • Flawed logic of the program
  • Some immature mistake when adding loops

Things to Remember: These errors do not give any error messages. However, they can be recognized by TDD (test-driven development) to indicate logic errors by displaying error messages. It makes a programmer’s life easier, undoubtedly!

Responses

Leave a Reply

%d bloggers like this: