none
why condition compilation? RRS feed

  • Question

  • I saw some code like below:

    #if !defined(POINT_H)
        #define POINT_H
    class Point {
    
    ...// the body of the class point
    
    };
    #endif

    I cannot understand why we need the condition compilation like above, or in other words, could you please tell me in which cases I have to use condition compilation. I appreciate you can give me some simple code segment to demonstrate the purpose of the  code above that use condition compilation .

    Thanks in advance!

    Thursday, May 3, 2012 4:39 AM

Answers