It is a const char[N]
(which is the same thing as char const[N]
), where N
is the length of the string plus one for the terminating NUL
(or just the length of the string if you define "length of a string" as already including the NUL
).
This is why you can do sizeof("hello") - 1
to get the number of characters in the string (including any embedded NUL
s); if it was a pointer, it wouldn't work because it would always be the size of pointer on your system (minus one).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…