On 11 Mar, 02:27, "comp.lang.c++" <cnhenu...@[EMAIL PROTECTED]
> wrote:
> thanks ,I think I konw .Because "abcde" is a constant ,t just point to
> it.and so t should be a constant pointer in fact.and char t[]=3D"abcde"
> is declare a array and give it's =A0elements vuales by "abcde" , and t
> is point to the first element's address.and I want to know how to
> judge if the pointer is point to a constant in my function ? thanks!
Since your function takes a pointer to char, it should not be pointing
to a constant. Just make sure to use const char pointers when dealing
with literals. Or preferably, std::string
DP


|