const
-
[C/C++] const 잘 사용하기Tech/Development 2011. 7. 5. 15:01
const를 어떻게 사용하고 있는지를 보면, C언어에 대한 조예가 어느정도 깊은지 알 수 있다고 한다. 실제로 아름답게 정리된 C 코드들을 보면 const를 자유롭게 활용하고 있는데, 이번 기회를 빌려 정리해보았다. const 자신의 왼편에 있는 키워드를 수식 // const applies to whatever is on its immediate left const int *Constant //Constant is variable pointer to a constant integer int const *Constant // an alternative syntax which does the same things int * const Constant // Constant is constant pointer ..