Use of '#ifndef'


    #include <iostream.h>
    #include <conio.h>
    /* macro named 'print' is not defined */
    void main()
    {
        int a = 10 ;
        clrscr () ;
        a = a + 1 ;
        #ifndef print      /* if macro 'print' is not defined */
            cout << "The macro 'print' is not defined" ;
        #else             /* if macro 'print' is defined */
            cout << "a = " << a ;
        #endif
        getch () ;
    }

No comments:

Post a Comment