What is a #error directive in c programming language?

Answer:

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 issues an error message and this error message includes.

e.g.:

 

#ifndef __MATH_H

#error First include then compile

#else

void main()

{

float a,b=25;

a=sqrt(b);

printf(“%f”,a);

}

#endif

Output: compiler error --> Error Directive: First include then compile

No comments: