Zero As Null
![]() if (cp != NULL) ... if (cp != (char*)0) ... if (cp != 0) ... if (cp) ... 는 모두 같다.
시스템에서는 NULL이 0이 아닐 수 있지만, 언제나 0은 정수 상수인 동시에 언어 명세상 null pointer constant로 정의되어 있다.
see also http://kldp.org/node/98257
EOF에 주로 -1이 쓰이기는 하지만, int인 음수면 된다.
|
Your mode of life will be changed for the better because of new developments. |