Error directive : error « Preprocessor « C Tutorial






specify an error message

//#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);
}
ERRORDIRECTIVE0.c:8:5: error: #error ERROR: NO_CURRENCY rate is specified.








12.10.error
12.10.1.Error directive