Home Show/Hide Menu
C Tutorials
➜ C Language
  - Features of C
  - First C Program
  - Compilation in C
  - C Character Set
  - Tokens
  - Keywords
  - Identifiers
  - Constants
  - Operators
  - Data Types
  - Variables
  - Type Casting
  - Comments
  - Input/Output
  - Escape Sequence
  - Programming Errors
➜ Control Statements
  - if Statement
  - if-else Statement
  - Nested if-else
  - else-if
  - switch Statement
  - Loop
  - while loop
  - do while loop
  - for loop
  - break
  - continue & goto
  - Nested Loop
  - Infinite Loop
➜ Functions
  - What is function
  - Call by Value & Reference
  - Recursive function
  - Storage Classes
➜ Array
  - 1-D Array
  - 2-D Array
  - Return an Array
  - Array to Function
➜ C Pointers
  - Pointers
  - Pointer to Pointer
  - Pointer Arithmetic
  - Dangling Pointers
  - sizeof() operator
  - const Pointer
  - void pointer
  - Dereference Pointer
  - Null Pointer
  - Function Pointer
  - Function pointer as argument
➜ Memory Management
  - Memory Layout of C
  - Dynamic memory
  - calloc()
  - malloc()
  - realloc()
  - free()
➜ Strings
  - gets() & puts()
  - String Functions
  - strlen()
  - strcpy()
  - strcat()
  - strcmp()
  - strrev()
  - strlwr()
  - strupr()
  - strstr()
➜ C Math
  - Math Functions
➜ Enum, Structure & Union
  - Enum
  - Structure
  - typedef
  - Array of Structures
  - Nested Structure
  - Structure Padding
  - Union
➜ File Handling
  - fprintf() fscanf()
  - fputc() fgetc()
  - fputs() fgets()
  - fseek()
  - EOF and feof()
  - fsetpos()
  - tmpfile()
  - rewind()
  - ftell()
  - lseek()
➜ Preprocessor
  - Preprocessor
  - Macros
  - #include
  - #define
  - #undef
  - #ifdef
  - #ifndef
  - #if
  - #else
  - #error
  - #pragma
➜ Command Line
  - Arguments

Programming Errors in C Language

Errors in C programming language are illegal operations or faults performed by the user which makes behavior of the program abnormal working of the program logic. Programming errors are identified during the time of compilation or execution. Some errors prevent the program from compiled or executed. Thus, the errors must be removed from the program for the successful execution of the program.


Types of Errors

There are mainly five types of errors exist in C programming:


  • Syntax Error - Errors occur when programmer violate the rules of writing C language syntax are known as "Syntax errors". The compiler error must be fixed before the compilation of code. All these errors are identified by the compiler, thus these types of errors are called 'compile-time errors'. Missing Parenthesis, printing the value of variable without declaration and missing semicolon are some of frequent syntax errors.
     
  • Run-time Error - array, pointer, structure, unionSometimes errors occur during the program execution after successful compilation are known as run-time errors. The division by zero, out of bounds index of array or string etc. are some run-time errors which errors are very hard to find at the compile time.
     
  • Linker Error - Linker errors occured when the executable file of the program is not generated and these can be happened either due to the wrong function prototyping or usage of the wrong header file.
     
  • Logical Error - The logical error is a bug in a program that leads to an undesired output, but not to terminate abnormally or crash of program. These errors solely depend on the logical thinking of programmer. Many different types of programming mistakes can cause logic errors. A logic error is also known as a logical error and these are not always easy to recognize immediately.
     
  • Semantic Error - Semantic errors occur when the statements written in the program are not meaningful or not understandable format to the C compiler.
     a+b=c; // semantic error
     int b = "Hello";


ADVERTISEMENT