const char * vs. char const *

const char s : char is constant.
char const
s: pointer is constant.

const는 바로 뒤에 나오는 것을 상수취급한다.

따라서 const char s
-> s++; (o)
s = ‘a’ (x)

char const s
-> s++; (x)
s = ‘a’ (o)

Author

Yohan Lee

Posted on

2020-02-28

Updated on

2021-08-22

Licensed under

댓글