#include <stdio.h>
int main()
{
char *const pText1 = "test_text";
*pText1 = 'a';
// 혹은 pText1[0] = 'a';
// 혹은 *pText1 = 10; 혹은 pText1[0] = 10;
return 0;
}
char *const :
will not allow you to change where the pointer points, but will allow you
change what is at that place in memory.
라고 합니다. 결론은... const가 포인터 변수의 주소를 const
시킵니다.. 포인터 값은 상관없이 변경 가능합니다..
즉 포인터 변수의 주소 변경은 할 수 없으나 포인터가