Basic things You need to Know in C++😁



What is an Error


Errors are the mistakes or faults in the program that causes our program to behave unexpectedly and it is no doubt that the well versed and experienced programmers also make mistakes. Programming error is generally known as bugs and the process to remove bugs from the program is called Debugging.

Syntax errors: Errors that occur when you violate the rules of writing C/C++ syntax are known as syntax errors. This compiler error indicates something that must be fixed before the code can be compiled. All these errors are detected by the compiler and thus are known as compile-time errors.
Run-time Errors : A runtime error occurs while the program is running. There are many different types of runtime errors. One example is the Logic Error, which produces the wrong output. Another type of error is Memory Leak. This type of error can cause a program to continually use up more RAM while the program is running. A memory may be due to an infinite loop, not deallocation unused memory, or other reasons. 

Linker Errors: A Linker is something that links a header files to the object code loads into the main memory at the time of execution of a program. If there is a linker error in your code it suggests that the code is compiled fine however, the required libraries or function cannot be found to complete the execution of the code. Due to this your executable file that is not generated and henceforth cannot carry out the program execution.


Logical Error:   On the Compilation and execution of a program, the desired output is not obtained when certain input values are given. These types of errors that provide incorrect output but appear to be error-free are called logical errors. These errors that provide incorrect output but appear to be error-free are called Logical Errors. These errors solely depend on the logical thinking of the programmer and are easy to detect if we follow the line of execution and determine why the program takes that path of execution.

Semantic errors: This error occurs when the statements written in the program are not meaningful to the compiler.


What are Keywords?

Keywords are predefined words or reserved words in C++ library with a fixed meaning and used to perform an internal operation. C++ Langauge supports more than 64 keywords.


asmdynamic_castnamespacereinterpret_cast
boolexplicitnewstatic_cast
catchfalseoperatortemplate
classfriendprivatethis
const_castinlinepublicthrow
deletemutableprotectedtrue
trytypeidtypenameusing
usingvirtualwchar_t


What are Preprocessors?


The preprocessors are the directives, which give instructions to the compiler to preprocess the information before actual compilation starts.
All preprocessor directives begin with #, and only white space characters may appear before a preprocessor directive on a line. Preprocessor directives are not C++ statements, so they do not end in a semicolon (;).
There are a number of preprocessors directives supported by C++ like #include, #define, #if, #else, #line, etc. 

Comments

Popular posts from this blog

Arrays and Vectors ❤️