Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   ifndef; endif Statement?? Can someone explain what is the following code mean?? (http://www.go4expert.com/forums/ifndef-endif-statement-explain-t20802/)

Flexline 29Jan2010 01:24

ifndef; endif Statement?? Can someone explain what is the following code mean??
 
/* Controller handle */
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct _MPIControl *MPIControl;
#if defined(__cplusplus)
}
#endif

shabbir 29Jan2010 11:03

Re: ifndef; endif Statement?? Can someone explain what is the following code mean??
 
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.


All times are GMT +5.5. The time now is 15:31.