#ifdef

Navigation:  Programming language SQC > Preprocessor >

#ifdef

Previous pageReturn to chapter overviewNext page

These are useful for checking if macros are set

 

Example:

 

#define DEBUG

 

#ifdef DEBUG

    #define SIZE  16

#else 

    #define SIZE  32

#endif

 

int main () 

{

 

#if(0)

    printf("Hello world");

#else

    printf("Hello Embedtron");

#endif

    

   return(0);

}