Monday, December 16, 2019

Errors in C Programming




Errors in C Programming :

There are three types of errors in c programming:

Compile Time Errors : Compile errors are those errors that occur at the time of compilation of the program. C compile errors may be further classified as:

1. Preprocessor error
#include<stdio.H> // small h
2. Translator error
int i;printf(%d, i);      // syntax error
3 Linkage error
int i=1;print("%d", i);   
// undefined reference error like using print instead of printf

Run-time Errors : Run time error are those error which occurs at the time of running of the program.
C run time errors may be further classified as:

1. Segmentation fault
int i;scanf("%d", i);    // segmentation error it should be scanf("%d",&i);  

2. Bus error:
--> Bus error is a fault raised by hardware, notifying an operating system (OS) that a process is trying to access memory that the CPU cannot physically address: an invalid address for the address bus.


No comments:

Post a Comment