Use of '#undef'


    #include <iostream.h>
    #include <conio.h>
    #define pi 3.14
    void main()
    {
        clrscr () ;
        #if pi == 3.142
            cout << "The value of pi = " << pi ;
        #else
            #undef pi     /* remove the definition of 'pi' */
            #define pi 3.142        /* redefine 'pi' */
            cout << "The modified value of pi = " << pi ;
        #endif
        getch ();
    }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|