unsigned short
-
unsigned short만 사용하면 warning이 뜬다.프로그래밍/C++ 2014. 8. 29. 15:38
int main(void) { unsigned short int length = 10; printf("Enter length : "); scanf("%u", &length); printf("value is %u \n", length); return 0; } 위 소스를 컴파일 하면 아래와 같은 warning을 내뿜는다.warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 2 has type ‘short unsigned int *’ [-Wformat] 결국 %u와 unsigned short와 타입(포맷)이 맞지 않는 다는 얘기이니 -Wformat 말고 직접 warning을 없애야 한다.Specifies that a follo..