C

[C] 195 매크로 상수가 선언되었는지 확인 #if~#endif

qkrwngus 2021. 2. 4. 19:43

Desc :

 

 


Source Code :

#include <stdio.h>

#define COUNT 100

#if !defined COUNT	// 매크로 상수가 정의되지않았는지
#define COUNT 90	// 참이라면 상수 선언
#endif

void main()
{
	printf("Count: %d \n", COUNT);
}

 


Result :