# error directive in c


Syntax : #error
If compiler compiles this line then it shows a compiler fatal error i.e it only issue an error message and this error message includes . i.e it only issue an error message and this error message includes .
Example :

#include<stdio.h>
#ifndef __MATH_H
#error First include then compile
#else
int main(){
    float a,b=25;
    a=sqrt(b);
    printf("%f",a);
    return 0;
}
#endif
Output: compiler error --> Error directive :First include then compile







  • Preprocessor definitions in c
  • Preprocessor directive in c
  • #include directive in c
  • # define directive in c
  • Pragma directive in c
  • Warning directive
  • Preprocessor operators in c
  • # if directive in c
  • #line directive in c
  • # error directive in c
  • # elif in c
  • # ifdef and #endif in c
  •  # ifndef in c example
  • #undef in c
  • What is header file in ?
  • C preprocessor questions
  • C tutorial home.
  • No comments: