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 5
In Progress

C++: Compilation Errors

Yasin Cakal 20 Nov 2021
Lesson Progress
0% Complete

The compiler is our first shield to pick errors. It can pick two error types:

  • Type erros: Errors occuring due to a mismatch between declared variable types.
  • Syntax errors: When the C++ syntax rules are violated, these errors occur.

Let’s go through some examples of type errors:

  • Storing different information in a mismatched variable type
  • Not declaring a variable before using it in the codes

Some examples of Syntax error types are:

  • Not adding one side of the included parenthesis ( ), { }, and [ ].
  • Not adding a semicolon ; after the statement ends in the code.

The compiler then states the line number where the error appeared to make it easier to identify and solve the error.

Responses

Leave a Reply

%d bloggers like this: