Memory Drive

반응형

[CODE type="c"]
main()
{
  #define TEST 100

  #ifdef TEST
       printf("TEST is defined.\n");
  #endif

  #ifdef SIZE
       printf("SIZE is defined.\n");
  #endif

  #ifndef TEST
       printf("TEST is not defined.\n");
  #endif

  #ifndef SIZE
       printf("SIZE is not defined.\n");
  #endif

  #undef TEST

  #define SIZE /* 값이 없게 정의되었으나 이도 엄연히 정의된 것이다 */

  #ifdef TEST
       printf("TEST is defined.\n");
  #endif
 
  #ifdef SIZE
       printf("SIZE is defined.\n");
  #endif

  #ifndef TEST
       printf("TEST is not defined.\n");
  #endif

  #ifndef SIZE
       printf("SIZE is not defined.\n");
  #endif
}

[/HTML][/CODE]

반응형