C Tutorial/Preprocessor/error
Error directive
specify an error message
<source lang="cpp">//#define USA 1
//#define EUP 1
- include <stdio.h>
- if (!defined (USA) || !defined (EUP))
#error ERROR: NO_CURRENCY rate is specified.
- endif
main() {
int rs; rs = 10; printf ("%d\n", rs);
}</source>
ERRORDIRECTIVE0.c:8:5: error: #error ERROR: NO_CURRENCY rate is specified.