Error directive

Error directive

specify an error message


//#define USA 1//w  w w .j ava  2 s . c  o m
//#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);
}

The code above generates the following result.





















Home »
  C Language »
    Language Advanced »




File
Function definition
String
Pointer
Structure
Preprocessing