1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ifndef; endif Statement?? Can someone explain what is the following code mean??

Discussion in 'C' started by Flexline, Jan 28, 2010.

  1. Flexline

    Flexline New Member

    Joined:
    Jan 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    /* Controller handle */
    #if defined(__cplusplus)
    extern "C" {
    #endif
    typedef struct _MPIControl *MPIControl;
    #if defined(__cplusplus)
    }
    #endif
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    It means
    Code:
    #if defined(__cplusplus)
    extern "C" {
    #endif
    
    If __cplusplus is defined I declare the statement extern "C" {

    else

    Code:
    typedef struct _MPIControl *MPIControl;
    Code:
    #if defined(__cplusplus)
    }
    #endif 
    If __cplusplus is defined I close the braces I opened before.
     

Share This Page