C

[C] 197 매크로 상수의 값 검사 #if~#endif

qkrwngus 2021. 2. 4. 20:01

Desc :

 

 


Source Code :

#include <stdio.h>

#define COUNT 100

#if COUNT != 100	//매크로 상수 COUNT가 100이 아니면
#error"COUNT != 100"	// 컴파일 에러 출력
#endif

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

 


Result :